| 2794 | |
| 2795 | |
| 2796 | bool 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 | |
| 2821 | void SharedMemoryBase::mutexUnlock() |
no test coverage detected