MCPcopy Create free account
hub / github.com/chen3feng/toft / OpenOrCreate

Method OpenOrCreate

system/threading/semaphore.cpp:89–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89bool NamedSemaphore::OpenOrCreate(const std::string& name,
90 unsigned int value,
91 mode_t mode)
92{
93 CheckNull();
94 sem_t* sem = sem_open(name.c_str(), O_CREAT, mode, value);
95 if (!sem)
96 return false;
97 m_sem = sem;
98 return true;
99}
100
101bool NamedSemaphore::Close()
102{

Callers 1

TESTFunction · 0.80

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.64