V8 Project
v8::base::anonymous_namespace{platform-unittest.cc}::ThreadLocalStorageTest Class Reference
+ Inheritance diagram for v8::base::anonymous_namespace{platform-unittest.cc}::ThreadLocalStorageTest:
+ Collaboration diagram for v8::base::anonymous_namespace{platform-unittest.cc}::ThreadLocalStorageTest:

Public Member Functions

 ThreadLocalStorageTest ()
 
 ~ThreadLocalStorageTest ()
 
virtual void Run () FINAL OVERRIDE
 
- Public Member Functions inherited from v8::base::Thread
 Thread (const Options &options)
 
virtual ~Thread ()
 
void Start ()
 
void StartSynchronously ()
 
void Join ()
 
const char * name () const
 
PlatformDatadata ()
 
void NotifyStartedAndRun ()
 

Static Private Member Functions

static void * GetValue (size_t x)
 

Private Attributes

Thread::LocalStorageKey keys_ [256]
 

Additional Inherited Members

- Public Types inherited from v8::base::Thread
typedef int32_t LocalStorageKey
 
- Static Public Member Functions inherited from v8::base::Thread
static LocalStorageKey CreateThreadLocalKey ()
 
static void DeleteThreadLocalKey (LocalStorageKey key)
 
static void * GetThreadLocal (LocalStorageKey key)
 
static int GetThreadLocalInt (LocalStorageKey key)
 
static void SetThreadLocal (LocalStorageKey key, void *value)
 
static void SetThreadLocalInt (LocalStorageKey key, int value)
 
static bool HasThreadLocal (LocalStorageKey key)
 
static void * GetExistingThreadLocal (LocalStorageKey key)
 
static void YieldCPU ()
 
- Static Public Attributes inherited from v8::base::Thread
static const int kMaxThreadNameLength = 16
 

Detailed Description

Definition at line 51 of file platform-unittest.cc.

Constructor & Destructor Documentation

◆ ThreadLocalStorageTest()

v8::base::anonymous_namespace{platform-unittest.cc}::ThreadLocalStorageTest::ThreadLocalStorageTest ( )
inline

Definition at line 53 of file platform-unittest.cc.

53  : Thread(Options("ThreadLocalStorageTest")) {
54  for (size_t i = 0; i < arraysize(keys_); ++i) {
56  }
57  }
Thread(const Options &options)
static LocalStorageKey CreateThreadLocalKey()
#define arraysize(array)
Definition: macros.h:86

References arraysize, and v8::base::Thread::CreateThreadLocalKey().

+ Here is the call graph for this function:

◆ ~ThreadLocalStorageTest()

v8::base::anonymous_namespace{platform-unittest.cc}::ThreadLocalStorageTest::~ThreadLocalStorageTest ( )
inline

Definition at line 58 of file platform-unittest.cc.

58  {
59  for (size_t i = 0; i < arraysize(keys_); ++i) {
61  }
62  }
static void DeleteThreadLocalKey(LocalStorageKey key)

References arraysize, and v8::base::Thread::DeleteThreadLocalKey().

+ Here is the call graph for this function:

Member Function Documentation

◆ GetValue()

static void* v8::base::anonymous_namespace{platform-unittest.cc}::ThreadLocalStorageTest::GetValue ( size_t  x)
inlinestaticprivate

Definition at line 93 of file platform-unittest.cc.

93  {
94  return reinterpret_cast<void*>(static_cast<uintptr_t>(x + 1));
95  }

◆ Run()

virtual void v8::base::anonymous_namespace{platform-unittest.cc}::ThreadLocalStorageTest::Run ( )
inlinevirtual

Implements v8::base::Thread.

Definition at line 64 of file platform-unittest.cc.

64  {
65  for (size_t i = 0; i < arraysize(keys_); i++) {
67  }
68  for (size_t i = 0; i < arraysize(keys_); i++) {
70  }
71  for (size_t i = 0; i < arraysize(keys_); i++) {
73  }
74  for (size_t i = 0; i < arraysize(keys_); i++) {
77  }
78  for (size_t i = 0; i < arraysize(keys_); i++) {
80  }
81  for (size_t i = 0; i < arraysize(keys_); i++) {
83  }
84  for (size_t i = 0; i < arraysize(keys_); i++) {
89  }
90  }
static void * GetThreadLocal(LocalStorageKey key)
static void * GetExistingThreadLocal(LocalStorageKey key)
Definition: platform.h:481
static bool HasThreadLocal(LocalStorageKey key)
Definition: platform.h:469
static void SetThreadLocal(LocalStorageKey key, void *value)
#define CHECK_EQ(expected, value)
Definition: logging.h:169
#define CHECK(condition)
Definition: logging.h:36

References arraysize, CHECK, CHECK_EQ, v8::base::Thread::GetExistingThreadLocal(), v8::base::Thread::GetThreadLocal(), v8::base::Thread::HasThreadLocal(), and v8::base::Thread::SetThreadLocal().

+ Here is the call graph for this function:

Member Data Documentation

◆ keys_

Thread::LocalStorageKey v8::base::anonymous_namespace{platform-unittest.cc}::ThreadLocalStorageTest::keys_[256]
private

Definition at line 97 of file platform-unittest.cc.


The documentation for this class was generated from the following file: