MCPcopy Create free account
hub / github.com/apple/foundationdb / Event

Method Event

flow/ThreadPrimitives.cpp:37–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35extern std::string format(const char* form, ...);
36
37Event::Event() {
38#ifdef _WIN32
39 ev = CreateEvent(nullptr, FALSE, FALSE, nullptr);
40#elif defined(__linux__) || defined(__FreeBSD__)
41 int result = sem_init(&sem, 0, 0);
42 if (result)
43 criticalError(FDB_EXIT_INIT_SEMAPHORE,
44 "UnableToInitializeSemaphore",
45 format("Could not initialize semaphore - %s", strerror(errno)).c_str());
46#elif defined(__APPLE__)
47 self = mach_task_self();
48 kern_return_t ret = semaphore_create(self, &sem, SYNC_POLICY_FIFO, 0);
49 if (ret != KERN_SUCCESS)
50 criticalError(FDB_EXIT_INIT_SEMAPHORE,
51 "UnableToInitializeSemaphore",
52 format("Could not initialize semaphore - %s", strerror(errno)).c_str());
53#else
54#error Port me!
55#endif
56}
57
58Event::~Event() {
59#ifdef _WIN32

Callers 4

wait_for_anyMethod · 0.45
__init__Method · 0.45
jquery.jsFile · 0.45

Calls 3

criticalErrorFunction · 0.85
formatFunction · 0.70
c_strMethod · 0.45

Tested by

no test coverage detected