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

Method mutexLockCond

src/common/isc_sync.cpp:2796–2818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2794
2795
2796bool SharedMemoryBase::mutexLockCond()
2797{
2798#if defined(WIN_NT)
2799
2800 return ISC_mutex_lock_cond(sh_mem_mutex) == 0;
2801
2802#else // POSIX SHARED MUTEX
2803
2804 int state = pthread_mutex_trylock(sh_mem_mutex->mtx_mutex);
2805#ifdef USE_ROBUST_MUTEX
2806 if (state == EOWNERDEAD)
2807 {
2808 // We always perform check for dead process
2809 // Therefore may safely mark mutex as recovered
2810 LOG_PTHREAD_ERROR(pthread_mutex_consistent(sh_mem_mutex->mtx_mutex));
2811 state = 0;
2812 }
2813#endif
2814 return state == 0;
2815
2816#endif // os-dependent choice
2817
2818}
2819
2820
2821void SharedMemoryBase::mutexUnlock()

Callers 2

acquire_shmemMethod · 0.80
tryLockMethod · 0.80

Calls 2

ISC_mutex_lock_condFunction · 0.85
pthread_mutex_trylockFunction · 0.85

Tested by

no test coverage detected