| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/thread_local_storage.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 ThreadLocalStorage::Slot::Slot(TLSDestructorFunc destructor) | 9 ThreadLocalStorage::Slot::Slot(TLSDestructorFunc destructor) |
| 10 : initialized_(false) { | 10 : initialized_(false) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 DCHECK(initialized_); | 35 DCHECK(initialized_); |
| 36 return pthread_getspecific(key_); | 36 return pthread_getspecific(key_); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void ThreadLocalStorage::Slot::Set(void* value) { | 39 void ThreadLocalStorage::Slot::Set(void* value) { |
| 40 DCHECK(initialized_); | 40 DCHECK(initialized_); |
| 41 int error = pthread_setspecific(key_, value); | 41 int error = pthread_setspecific(key_, value); |
| 42 if (error) | 42 if (error) |
| 43 NOTREACHED(); | 43 NOTREACHED(); |
| 44 } | 44 } |
| 45 | |
| OLD | NEW |