Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(724)

Side by Side Diff: base/threading/thread_local_storage_posix.cc

Issue 5986012: Move thread local stuff from base to base/threading and consistently use the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/threading/thread_local_storage.h ('k') | base/threading/thread_local_storage_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/thread_local_storage.h" 5 #include "base/threading/thread_local_storage.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace base {
10
9 ThreadLocalStorage::Slot::Slot(TLSDestructorFunc destructor) 11 ThreadLocalStorage::Slot::Slot(TLSDestructorFunc destructor)
10 : initialized_(false) { 12 : initialized_(false) {
11 Initialize(destructor); 13 Initialize(destructor);
12 } 14 }
13 15
14 bool ThreadLocalStorage::Slot::Initialize(TLSDestructorFunc destructor) { 16 bool ThreadLocalStorage::Slot::Initialize(TLSDestructorFunc destructor) {
15 DCHECK(!initialized_); 17 DCHECK(!initialized_);
16 int error = pthread_key_create(&key_, destructor); 18 int error = pthread_key_create(&key_, destructor);
17 if (error) { 19 if (error) {
18 NOTREACHED(); 20 NOTREACHED();
(...skipping 16 matching lines...) Expand all
35 DCHECK(initialized_); 37 DCHECK(initialized_);
36 return pthread_getspecific(key_); 38 return pthread_getspecific(key_);
37 } 39 }
38 40
39 void ThreadLocalStorage::Slot::Set(void* value) { 41 void ThreadLocalStorage::Slot::Set(void* value) {
40 DCHECK(initialized_); 42 DCHECK(initialized_);
41 int error = pthread_setspecific(key_, value); 43 int error = pthread_setspecific(key_, value);
42 if (error) 44 if (error)
43 NOTREACHED(); 45 NOTREACHED();
44 } 46 }
47
48 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/thread_local_storage.h ('k') | base/threading/thread_local_storage_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698