| 428 | } |
| 429 | |
| 430 | extern "C" void fastlock_unlock(struct fastlock *lock) |
| 431 | { |
| 432 | --lock->m_depth; |
| 433 | if (lock->m_depth == 0) |
| 434 | { |
| 435 | int pidT; |
| 436 | __atomic_load(&lock->m_pidOwner, &pidT, __ATOMIC_RELAXED); |
| 437 | serverAssert(pidT >= 0); // unlock after free |
| 438 | int t = -1; |
| 439 | __atomic_store(&lock->m_pidOwner, &t, __ATOMIC_RELEASE); |
| 440 | std::atomic_thread_fence(std::memory_order_acq_rel); |
| 441 | ANNOTATE_RWLOCK_RELEASED(lock, true); |
| 442 | uint16_t activeNew = __atomic_add_fetch(&lock->m_ticket.m_active, 1, __ATOMIC_RELEASE); // on x86 the atomic is not required here, but ASM handles that case |
| 443 | #ifdef __linux__ |
| 444 | unlock_futex(lock, activeNew); |
| 445 | #else |
| 446 | UNUSED(activeNew); |
| 447 | #endif |
| 448 | } |
| 449 | } |
| 450 | #endif |
| 451 | |
| 452 | #ifdef __linux__ |
no test coverage detected