Lines Matching defs:Thread
67 // 0 is never a valid thread id.
543 // POSIX thread support.
546 class Thread::PlatformData {
549 pthread_t thread_; // Thread handle for pthread.
550 // Synchronizes thread creation
554 Thread::Thread(const Options& options)
565 Thread::~Thread() {
574 STATIC_ASSERT(Thread::kMaxThreadNameLength <= PTHREAD_MAX_NAMELEN_NP);
587 STATIC_ASSERT(Thread::kMaxThreadNameLength <= kMaxNameLength);
598 Thread* thread = reinterpret_cast<Thread*>(arg);
600 // we don't know which thread will run first (the original thread or the new
602 { LockGuard<Mutex> lock_guard(&thread->data()->thread_creation_mutex_); }
603 SetThreadName(thread->name());
604 DCHECK(thread->data()->thread_ != kNoThread);
605 thread->NotifyStartedAndRun();
610 void Thread::set_name(const char* name) {
616 void Thread::Start() {
648 void Thread::Join() {
653 static Thread::LocalStorageKey PthreadKeyToLocalKey(pthread_key_t pthread_key) {
655 // We need to cast pthread_key_t to Thread::LocalStorageKey in two steps
658 STATIC_ASSERT(sizeof(Thread::LocalStorageKey) == sizeof(pthread_key_t));
660 return static_cast<Thread::LocalStorageKey>(ptr_key);
662 return static_cast<Thread::LocalStorageKey>(pthread_key);
667 static pthread_key_t LocalKeyToPthreadKey(Thread::LocalStorageKey local_key) {
669 STATIC_ASSERT(sizeof(Thread::LocalStorageKey) == sizeof(pthread_key_t));
720 static void CheckFastTls(Thread::LocalStorageKey key) {
722 Thread::SetThreadLocal(key, expected);
723 void* actual = Thread::GetExistingThreadLocal(key);
728 Thread::SetThreadLocal(key, NULL);
734 Thread::LocalStorageKey Thread::CreateThreadLocalKey() {
755 void Thread::DeleteThreadLocalKey(LocalStorageKey key) {
763 void* Thread::GetThreadLocal(LocalStorageKey key) {
769 void Thread::SetThreadLocal(LocalStorageKey key, void* value) {