Vuo
2.4.4
Loading...
Searching...
No Matches
base
VuoThreadUtilities.cc
Go to the documentation of this file.
1
10
#include "
VuoThreadUtilities.hh
"
11
15
VuoThreadUtilities::Semaphore::Semaphore
(
void
) :
16
count(1)
17
{
18
}
19
23
void
VuoThreadUtilities::Semaphore::acquire
(
void
)
24
{
25
std::unique_lock<std::mutex> lock(mtx);
26
cv.wait(lock, [
this
](){
return
count > 0; });
27
--count;
28
}
29
33
void
VuoThreadUtilities::Semaphore::release
(
void
)
34
{
35
std::unique_lock<std::mutex> lock(mtx);
36
count++;
37
lock.unlock();
38
cv.notify_one();
39
}
Generated on Thu Nov 9 2023 16:59:28 for Vuo by
1.9.8