| 40 | } |
| 41 | |
| 42 | IEventQueueBuffer::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 | |
| 58 | bool OSXEventQueueBuffer::addEvent(uint32_t dataID) |
| 59 | { |