#include <SkSemaphore.h>
Definition at line 18 of file SkSemaphore.h.
◆ SkSemaphore()
constexpr SkSemaphore::SkSemaphore |
( |
int |
count = 0 | ) |
|
|
inlineconstexpr |
◆ ~SkSemaphore()
SkSemaphore::~SkSemaphore |
( |
| ) |
|
◆ signal()
void SkSemaphore::signal |
( |
int |
n = 1 | ) |
|
|
inline |
Definition at line 56 of file SkSemaphore.h.
56 {
57 int prev = fCount.fetch_add(n, std::memory_order_release);
58
59
60
61
62
63
64
65
66
67
69 if (toSignal > 0) {
70 this->osSignal(toSignal);
71 }
72}
static float prev(float f)
static float min(float r, float g, float b)
◆ try_wait()
bool SkSemaphore::try_wait |
( |
| ) |
|
Definition at line 77 of file SkSemaphore.cpp.
77 {
78 int count = fCount.load(std::memory_order_relaxed);
80 return fCount.compare_exchange_weak(
count,
count-1, std::memory_order_acquire);
81 }
82 return false;
83}
◆ wait()
void SkSemaphore::wait |
( |
| ) |
|
|
inline |
Definition at line 74 of file SkSemaphore.h.
74 {
75
76
77 if (fCount.fetch_sub(1, std::memory_order_acquire) <= 0) {
79 this->osWait();
81 }
82}
#define SK_POTENTIALLY_BLOCKING_REGION_END
#define SK_POTENTIALLY_BLOCKING_REGION_BEGIN
The documentation for this class was generated from the following files: