summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/SConscript3
-rw-r--r--base/thread_posix.cc8
2 files changed, 6 insertions, 5 deletions
diff --git a/base/SConscript b/base/SConscript
index 190fdfd..bf07eb4 100644
--- a/base/SConscript
+++ b/base/SConscript
@@ -163,8 +163,8 @@ if env['PLATFORM'] == 'darwin':
'clipboard_mac.cc',
'file_util_mac.mm',
'file_version_info_mac.mm',
- 'thread_posix.cc',
'sys_string_conversions_mac.cc',
+ 'thread_posix.cc',
])
if env['PLATFORM'] == 'posix':
@@ -173,6 +173,7 @@ if env['PLATFORM'] == 'posix':
'base_paths_linux.cc',
'file_util_linux.cc',
'sys_string_conversions_linux.cc',
+ 'thread_posix.cc',
])
env.ChromeStaticLibrary('base', input_files)
diff --git a/base/thread_posix.cc b/base/thread_posix.cc
index 11b98bf..59cd770 100644
--- a/base/thread_posix.cc
+++ b/base/thread_posix.cc
@@ -48,7 +48,6 @@ Thread::Thread(const char *name)
: thread_id_(0),
message_loop_(NULL),
name_(name) {
- DCHECK(tls_index_) << "static initializer failed";
}
Thread::~Thread() {
@@ -67,14 +66,15 @@ void* ThreadFunc(void* closure) {
// Thread to setup and run a MessageLoop.
// Note that if we start doing complex stuff in other static initializers
// this could cause problems.
-TLSSlot Thread::tls_index_ = ThreadLocalStorage::Alloc();
+// TODO(evanm): don't rely on static initialization.
+TLSSlot Thread::tls_index_;
void Thread::SetThreadWasQuitProperly(bool flag) {
- ThreadLocalStorage::Set(tls_index_, reinterpret_cast<void*>(flag));
+ tls_index_.Set(reinterpret_cast<void*>(flag));
}
bool Thread::GetThreadWasQuitProperly() {
- return (ThreadLocalStorage::Get(tls_index_) != 0);
+ return (tls_index_.Get() != 0);
}