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

Method eventPost

src/common/isc_sync.cpp:820–858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

818
819
820int SharedMemoryBase::eventPost(event_t* event)
821{
822/**************************************
823 *
824 * I S C _ e v e n t _ p o s t
825 *
826 **************************************
827 *
828 * Functional description
829 * Post an event to wake somebody else up.
830 *
831 **************************************/
832
833#if defined(WIN_NT)
834
835 ++event->event_count;
836
837 if (event->event_pid != process_id)
838 return ISC_kill(event->event_pid, event->event_id, event->event_handle) == 0 ? FB_SUCCESS : FB_FAILURE;
839
840 return SetEvent(event->event_handle) ? FB_SUCCESS : FB_FAILURE;
841
842#else // pthread-based event
843
844 PTHREAD_ERROR(pthread_mutex_lock(event->event_mutex));
845 ++event->event_count;
846 const int ret = pthread_cond_broadcast(event->event_cond);
847 PTHREAD_ERROR(pthread_mutex_unlock(event->event_mutex));
848 if (ret)
849 {
850 gds__log ("ISC_event_post: pthread_cond_broadcast failed with errno = %d", ret);
851 return FB_FAILURE;
852 }
853
854 return FB_SUCCESS;
855
856#endif // OS-dependent choice
857
858} // anonymous namespace
859
860
861#ifdef UNIX

Callers 12

~LockManagerMethod · 0.80
post_wakeupMethod · 0.80
remap_local_ownersMethod · 0.80
signal_ownerMethod · 0.80
~ProfilerListenerMethod · 0.80
watcherThreadMethod · 0.80
~EventManagerMethod · 0.80
post_processMethod · 0.80
shutdownMethod · 0.80
clearCacheMethod · 0.80
clearDeliveryThreadMethod · 0.80

Calls 4

ISC_killFunction · 0.85
pthread_mutex_lockFunction · 0.85
pthread_cond_broadcastFunction · 0.85
pthread_mutex_unlockFunction · 0.85

Tested by

no test coverage detected