Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
SkSemaphore::OSSemaphore Struct Reference

Public Member Functions

 OSSemaphore ()
 
 ~OSSemaphore ()
 
void signal (int n)
 
void wait ()
 

Public Attributes

sem_t fSemaphore
 

Detailed Description

Definition at line 47 of file SkSemaphore.cpp.

Constructor & Destructor Documentation

◆ OSSemaphore()

SkSemaphore::OSSemaphore::OSSemaphore ( )
inline

Definition at line 50 of file SkSemaphore.cpp.

50{ sem_init(&fSemaphore, 0/*cross process?*/, 0/*initial count*/); }

◆ ~OSSemaphore()

SkSemaphore::OSSemaphore::~OSSemaphore ( )
inline

Definition at line 51 of file SkSemaphore.cpp.

51{ sem_destroy(&fSemaphore); }

Member Function Documentation

◆ signal()

void SkSemaphore::OSSemaphore::signal ( int  n)
inline

Definition at line 53 of file SkSemaphore.cpp.

53{ while (n --> 0) { sem_post(&fSemaphore); } }

◆ wait()

void SkSemaphore::OSSemaphore::wait ( )
inline

Definition at line 54 of file SkSemaphore.cpp.

54 {
55 // Try until we're not interrupted.
56 while(sem_wait(&fSemaphore) == -1 && errno == EINTR);
57 }

Member Data Documentation

◆ fSemaphore

sem_t SkSemaphore::OSSemaphore::fSemaphore

Definition at line 48 of file SkSemaphore.cpp.


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