summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-20 23:53:40 +0000
committerevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-20 23:53:40 +0000
commit78c768e168d0af4452eddf936731ef11ef282bc6 (patch)
tree0d976338bb5141c266a184f0549d132c8b7a21ce /base
parent4de93aa65da7067c8d253f073435e8d8ae5b1da9 (diff)
downloadchromium_src-78c768e168d0af4452eddf936731ef11ef282bc6.zip
chromium_src-78c768e168d0af4452eddf936731ef11ef282bc6.tar.gz
chromium_src-78c768e168d0af4452eddf936731ef11ef282bc6.tar.bz2
Bring thread_posix into Linux build and fix it for Linux/Mac.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1133 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-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);
}