| 1136 | } |
| 1137 | |
| 1138 | bool FastPthreadMutex::try_lock() { |
| 1139 | auto split = (bthread::MutexInternal*)&_futex; |
| 1140 | bool lock = !split->locked.exchange(1, butil::memory_order_acquire); |
| 1141 | if (lock) { |
| 1142 | PTHREAD_MUTEX_SET_OWNER(_owner); |
| 1143 | ADD_TLS_PTHREAD_LOCK_COUNT; |
| 1144 | } |
| 1145 | return lock; |
| 1146 | } |
| 1147 | |
| 1148 | bool FastPthreadMutex::timed_lock(const struct timespec* abstime) { |
| 1149 | if (try_lock()) { |
no test coverage detected