MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / eventClear

Method eventClear

src/common/isc_sync.cpp:676–711  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

674
675
676SLONG SharedMemoryBase::eventClear(event_t* event)
677{
678/**************************************
679 *
680 * I S C _ e v e n t _ c l e a r
681 *
682 **************************************
683 *
684 * Functional description
685 * Clear an event preparatory to waiting on it. The order of
686 * battle for event synchronization is:
687 *
688 * 1. Clear event.
689 * 2. Test data structure for event already completed
690 * 3. Wait on event.
691 *
692 **************************************/
693
694 fb_assert(event->event_pid == getpid());
695
696#if defined(WIN_NT)
697
698 ResetEvent(event->event_handle);
699
700 return event->event_count + 1;
701
702#else // pthread-based event
703
704 LOG_PTHREAD_ERROR(pthread_mutex_lock(event->event_mutex));
705 const SLONG ret = event->event_count + 1;
706 LOG_PTHREAD_ERROR(pthread_mutex_unlock(event->event_mutex));
707 return ret;
708
709#endif // OS-dependent choice
710
711}
712
713
714int SharedMemoryBase::eventWait(event_t* event, const SLONG value, const SLONG micro_seconds)

Callers 7

wait_for_requestMethod · 0.80
watcherThreadMethod · 0.80
watcher_threadMethod · 0.80
clearCacheMethod · 0.80
clearDeliveryThreadMethod · 0.80

Calls 2

pthread_mutex_lockFunction · 0.85
pthread_mutex_unlockFunction · 0.85

Tested by

no test coverage detected