| 88 | #endif // _win_ |
| 89 | |
| 90 | inline bool TryAcquire() noexcept { |
| 91 | #if defined(_win_) |
| 92 | return TryEnterCriticalSectionInt(&Obj); |
| 93 | #else |
| 94 | int result = pthread_mutex_trylock(&Obj); |
| 95 | if (result == 0 || result == EBUSY) { |
| 96 | return result == 0; |
| 97 | } |
| 98 | Y_ABORT("mutex trylock failure (%s)", LastSystemErrorText(result)); |
| 99 | #endif |
| 100 | } |
| 101 | |
| 102 | inline void Release() noexcept { |
| 103 | #if defined(_win_) |
nothing calls this directly
no test coverage detected