commit | d0e7e777c412071a911dd2c008b20b7d879fd392 | [log] [tgz] |
---|---|---|
author | Carl Shapiro <cshapiro@google.com> | Fri Jul 15 14:31:01 2011 -0700 |
committer | Carl Shapiro <cshapiro@google.com> | Fri Jul 15 14:31:01 2011 -0700 |
tree | 80fa58a73e98a647619521c077cfc5ddb3080006 | |
parent | f10edcac1f8ab835d60fc8268f8c574005619998 [diff] [blame] |
Use a TLS value to retrieve the current thread. Change-Id: Iaea97c0f5e10ea59ebf6c623d802f51f87bd4214
diff --git a/src/thread.h b/src/thread.h index 55c1b11..a862e0a 100644 --- a/src/thread.h +++ b/src/thread.h
@@ -83,8 +83,8 @@ static Thread* Attach(); static Thread* Current() { - static Thread self; - return &self; // TODO + void* thread = pthread_getspecific(Thread::pthread_key_self_); + return reinterpret_cast<Thread*>(thread); } uint32_t GetId() const {