| 2766 | |
| 2767 | |
| 2768 | void SharedMemoryBase::mutexLock() |
| 2769 | { |
| 2770 | #if defined(WIN_NT) |
| 2771 | |
| 2772 | int state = ISC_mutex_lock(sh_mem_mutex); |
| 2773 | |
| 2774 | #else // POSIX SHARED MUTEX |
| 2775 | |
| 2776 | int state = pthread_mutex_lock(sh_mem_mutex->mtx_mutex); |
| 2777 | #ifdef USE_ROBUST_MUTEX |
| 2778 | if (state == EOWNERDEAD) |
| 2779 | { |
| 2780 | // We always perform check for dead process |
| 2781 | // Therefore may safely mark mutex as recovered |
| 2782 | LOG_PTHREAD_ERROR(pthread_mutex_consistent(sh_mem_mutex->mtx_mutex)); |
| 2783 | state = 0; |
| 2784 | } |
| 2785 | #endif |
| 2786 | |
| 2787 | #endif // os-dependent choice |
| 2788 | |
| 2789 | if (state != 0) |
| 2790 | { |
| 2791 | sh_mem_callback->mutexBug(state, "mutexLock"); |
| 2792 | } |
| 2793 | } |
| 2794 | |
| 2795 | |
| 2796 | bool SharedMemoryBase::mutexLockCond() |