| 1039 | #endif // BRPC_DEBUG_LOCK |
| 1040 | |
| 1041 | inline int mutex_trylock_impl(bthread_mutex_t* m) { |
| 1042 | MutexInternal* split = (MutexInternal*)m->butex; |
| 1043 | if (!split->locked.exchange(1, butil::memory_order_acquire)) { |
| 1044 | BTHREAD_MUTEX_SET_OWNER; |
| 1045 | return 0; |
| 1046 | } |
| 1047 | return EBUSY; |
| 1048 | } |
| 1049 | |
| 1050 | const int MAX_SPIN_ITER = 4; |
| 1051 |
no test coverage detected