carb::thread::futex::wake

Defined in carb/thread/Futex.h

template<class T>
inline void carb::thread::futex::wake(std::atomic<T> &val, unsigned count, unsigned maxCount = unsigned(INT_MAX))

Wakes threads that are waiting in one of the futex wait functions.

Note

To wake all threads waiting on val, use wake_all().

Parameters
  • val – The same value that was passed to wait(), wait_for() or wait_until().

  • count – The number of threads to wake. To wake all threads, use wake_all().

  • maxCount – An optimization for Windows that specifies the total number of threads that are waiting on addr. If count is greater-than-or-equal-to maxCount then a specific API call that wakes all threads is used. Ignored on Linux.