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

Public Member Functions

 ProducerThread (char *buffer, Semaphore *free_space, Semaphore *used_space)
 
virtual ~ProducerThread ()
 
virtual void Run () OVERRIDE
 
 ConsumerThread (const char *buffer, Semaphore *free_space, Semaphore *used_space)
 
virtual ~ConsumerThread ()
 
virtual void Run () OVERRIDE
 
 WaitAndSignalThread (Semaphore *semaphore)
 
virtual ~WaitAndSignalThread ()
 
virtual void Run () 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 ()
 

Private Attributes

char * buffer_
 
Semaphore *const free_space_
 
Semaphore *const used_space_
 
const char * buffer_
 
Semaphore *const semaphore_
 

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 23 of file semaphore-unittest.cc.

Constructor & Destructor Documentation

◆ ~ProducerThread()

virtual v8::base::anonymous_namespace{semaphore-unittest.cc}::FINAL::~ProducerThread ( )
inlinevirtual

Definition at line 30 of file semaphore-unittest.cc.

30 {}

◆ ~ConsumerThread()

virtual v8::base::anonymous_namespace{semaphore-unittest.cc}::FINAL::~ConsumerThread ( )
inlinevirtual

Definition at line 55 of file semaphore-unittest.cc.

55 {}

◆ ~WaitAndSignalThread()

virtual v8::base::anonymous_namespace{semaphore-unittest.cc}::FINAL::~WaitAndSignalThread ( )
inlinevirtual

Definition at line 76 of file semaphore-unittest.cc.

76 {}

Member Function Documentation

◆ ConsumerThread()

v8::base::anonymous_namespace{semaphore-unittest.cc}::FINAL::ConsumerThread ( const char *  buffer,
Semaphore *  free_space,
Semaphore *  used_space 
)
inline

◆ ProducerThread()

v8::base::anonymous_namespace{semaphore-unittest.cc}::FINAL::ProducerThread ( char *  buffer,
Semaphore *  free_space,
Semaphore *  used_space 
)
inline

Definition at line 25 of file semaphore-unittest.cc.

26  : Thread(Options("ProducerThread")),
27  buffer_(buffer),
28  free_space_(free_space),
29  used_space_(used_space) {}

◆ Run() [1/3]

◆ Run() [2/3]

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

◆ Run() [3/3]

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

Implements v8::base::Thread.

Definition at line 78 of file semaphore-unittest.cc.

78  {
79  for (int n = 0; n < 100; ++n) {
80  semaphore_->Wait();
81  ASSERT_FALSE(semaphore_->WaitFor(TimeDelta::FromMicroseconds(1)));
82  semaphore_->Signal();
83  }
84  }

◆ WaitAndSignalThread()

v8::base::anonymous_namespace{semaphore-unittest.cc}::FINAL::WaitAndSignalThread ( Semaphore *  semaphore)
inlineexplicit

Definition at line 74 of file semaphore-unittest.cc.

75  : Thread(Options("WaitAndSignalThread")), semaphore_(semaphore) {}

Member Data Documentation

◆ buffer_ [1/2]

char* v8::base::anonymous_namespace{semaphore-unittest.cc}::FINAL::buffer_
private

Definition at line 41 of file semaphore-unittest.cc.

◆ buffer_ [2/2]

const char* v8::base::anonymous_namespace{semaphore-unittest.cc}::FINAL::buffer_
private

Definition at line 66 of file semaphore-unittest.cc.

◆ free_space_

Semaphore *const v8::base::anonymous_namespace{semaphore-unittest.cc}::FINAL::free_space_
private

Definition at line 42 of file semaphore-unittest.cc.

◆ semaphore_

Semaphore* const v8::base::anonymous_namespace{semaphore-unittest.cc}::FINAL::semaphore_
private

Definition at line 87 of file semaphore-unittest.cc.

◆ used_space_

Semaphore *const v8::base::anonymous_namespace{semaphore-unittest.cc}::FINAL::used_space_
private

Definition at line 43 of file semaphore-unittest.cc.


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