MCPcopy Create free account
hub / github.com/deskflow/deskflow / getEvent

Method getEvent

src/lib/platform/OSXEventQueueBuffer.cpp:42–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42IEventQueueBuffer::Type OSXEventQueueBuffer::getEvent(Event &event, uint32_t &dataID)
43{
44 std::unique_lock lock(m_mutex);
45 if (m_dataQueue.empty()) {
46 LOG_DEBUG2("no events in queue");
47 return IEventQueueBuffer::Type::Unknown;
48 }
49
50 dataID = m_dataQueue.front();
51 m_dataQueue.pop();
52 lock.unlock(); // Unlock early to allow other threads to proceed
53
54 LOG_DEBUG2("handled user event with dataID: %u", dataID);
55 return IEventQueueBuffer::Type::User;
56}
57
58bool OSXEventQueueBuffer::addEvent(uint32_t dataID)
59{

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.45
popMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected