diff options
author | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-20 21:47:40 +0000 |
---|---|---|
committer | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-20 21:47:40 +0000 |
commit | c3ec35638ea6594b6bdbac7ff92c38add8984623 (patch) | |
tree | c51541ac2451e66c410b3d244e1f59ac2218c57e /chrome/common/notification_service.h | |
parent | e537c3515e270527ba2fa54fcfc4a1ed49cc975e (diff) | |
download | chromium_src-c3ec35638ea6594b6bdbac7ff92c38add8984623.zip chromium_src-c3ec35638ea6594b6bdbac7ff92c38add8984623.tar.gz chromium_src-c3ec35638ea6594b6bdbac7ff92c38add8984623.tar.bz2 |
TrackedObjects assumes you can use a "TLS slot" of -1 to indicate uninitialized. This isn't true for the pthread_key_t type, which is unsigned on Linux and reportedly a struct on Macs. This change modifies the Slot type to be a struct containing an "initialized" flag.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1113 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/notification_service.h')
-rw-r--r-- | chrome/common/notification_service.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/chrome/common/notification_service.h b/chrome/common/notification_service.h index 1243748..6ad58d0 100644 --- a/chrome/common/notification_service.h +++ b/chrome/common/notification_service.h @@ -36,8 +36,8 @@ #include <map> -#include "base/thread_local_storage.h" #include "base/observer_list.h" +#include "base/thread_local_storage.h" #include "base/values.h" #include "chrome/common/notification_details.h" #include "chrome/common/notification_source.h" @@ -50,8 +50,7 @@ class NotificationService { // Returns the NotificationService object for the current thread, or NULL if // none. static NotificationService* current() { - return static_cast<NotificationService *>( - ThreadLocalStorage::Get(tls_index_)); + return static_cast<NotificationService *>(tls_index_.Get()); } // Normally instantiated when the thread is created. Not all threads have @@ -119,7 +118,7 @@ class NotificationService { // The thread local storage index, used for getting the current thread's // instance. - static int tls_index_; + static TLSSlot tls_index_; #ifndef NDEBUG // Used to check to see that AddObserver and RemoveObserver calls are |