summaryrefslogtreecommitdiffstats
path: root/base/thread.cc
diff options
context:
space:
mode:
authorevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-20 22:11:47 +0000
committerevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-20 22:11:47 +0000
commitfa87a2527ca8c0bcef92d8e44791332782936911 (patch)
tree04dc5d1e6881f8356f91203a386648057b20d924 /base/thread.cc
parent4f64d0af5908e36d356c834005d08cca98d579fe (diff)
downloadchromium_src-fa87a2527ca8c0bcef92d8e44791332782936911.zip
chromium_src-fa87a2527ca8c0bcef92d8e44791332782936911.tar.gz
chromium_src-fa87a2527ca8c0bcef92d8e44791332782936911.tar.bz2
Revert. Failing unit tests.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1118 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/thread.cc')
-rw-r--r--base/thread.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/base/thread.cc b/base/thread.cc
index 6998deb..629c7e0 100644
--- a/base/thread.cc
+++ b/base/thread.cc
@@ -69,6 +69,7 @@ Thread::Thread(const char *name)
thread_id_(0),
message_loop_(NULL),
name_(name) {
+ DCHECK(tls_index_) << "static initializer failed";
}
Thread::~Thread() {
@@ -81,19 +82,18 @@ Thread::~Thread() {
// Thread to setup and run a MessageLoop.
// Note that if we start doing complex stuff in other static initializers
// this could cause problems.
-// TODO(evanm): this shouldn't rely on static initialization.
-TLSSlot Thread::tls_index_;
+TLSSlot Thread::tls_index_ = ThreadLocalStorage::Alloc();
void Thread::SetThreadWasQuitProperly(bool flag) {
#ifndef NDEBUG
- tls_index_.Set(reinterpret_cast<void*>(flag));
+ ThreadLocalStorage::Set(tls_index_, reinterpret_cast<void*>(flag));
#endif
}
bool Thread::GetThreadWasQuitProperly() {
bool quit_properly = true;
#ifndef NDEBUG
- quit_properly = (tls_index_.Get() != 0);
+ quit_properly = (ThreadLocalStorage::Get(tls_index_) != 0);
#endif
return quit_properly;
}