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

Unified Diff: base/threading/thread_local_storage.h

Issue 8702014: Make ThreadLocalStorage more posix pthread compliant (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: base/threading/thread_local_storage.h
===================================================================
--- base/threading/thread_local_storage.h (revision 111452)
+++ base/threading/thread_local_storage.h (working copy)
@@ -6,6 +6,7 @@
#define BASE_THREADING_THREAD_LOCAL_STORAGE_H_
#pragma once
+#include "base/atomicops.h"
#include "base/base_export.h"
#include "base/basictypes.h"
@@ -79,13 +80,15 @@
private:
// The maximum number of 'slots' in our thread local storage stack.
- // For now, this is fixed. We could either increase statically, or
- // we could make it dynamic in the future.
static const int kThreadLocalStorageSize = 64;
+ // The maximum number of times to try to clear slots by caling destructors.
willchan no longer on Chromium 2011/11/29 01:46:49 s/caling/calling/
jar (doing other things) 2011/11/29 02:32:45 Done.
+ // Use pthread naming convention for clarity.
+ static const int PTHREAD_DESTRUCTOR_ITERATIONS = kThreadLocalStorageSize;
rvargas (doing something else) 2011/11/29 01:26:31 I don't see why we want to expose this value in th
jar (doing other things) 2011/11/29 02:32:45 Done.
+
static long tls_key_;
static long tls_max_;
- static TLSDestructorFunc tls_destructors_[kThreadLocalStorageSize];
+ static subtle::AtomicWord tls_destructors_[kThreadLocalStorageSize];
#endif // OS_WIN
DISALLOW_COPY_AND_ASSIGN(ThreadLocalStorage);
« no previous file with comments | « no previous file | base/threading/thread_local_storage_unittest.cc » ('j') | base/threading/thread_local_storage_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698