| 134 | namespace bthread { |
| 135 | |
| 136 | static void wakeup_pthread(ButexPthreadWaiter* pw) { |
| 137 | // release fence makes wait_pthread see changes before wakeup. |
| 138 | pw->sig.store(PTHREAD_SIGNALLED, butil::memory_order_release); |
| 139 | // At this point, wait_pthread() possibly has woken up and destroyed `pw'. |
| 140 | // In which case, futex_wake_private() should return EFAULT. |
| 141 | // If crash happens in future, `pw' can be made TLS and never destroyed |
| 142 | // to solve the issue. |
| 143 | futex_wake_private(&pw->sig, 1); |
| 144 | } |
| 145 | |
| 146 | bool erase_from_butex(ButexWaiter*, bool, WaiterState); |
| 147 |
no test coverage detected