fairness  v1.0.0
A collection of advanced syncronization mechanisms.
Loading...
Searching...
No Matches
wait_ops_generic.hpp
Go to the documentation of this file.
1
14#ifndef BOOST_FAIRNESS_WAIT_OPS_GENERIC_HPP
15#define BOOST_FAIRNESS_WAIT_OPS_GENERIC_HPP
17#include <atomic>
18
20
21 template<typename T, typename K>
22 inline void wait_(T& mem, K expected){
23 static_assert(
24 T::is_always_lock_free
25 , "Invalid argument size on boost::fairness::detail::wait"
26 );
27 mem.wait(expected, std::memory_order_relaxed);
28 }
29
30 template<typename T>
31 inline void notify_one_(T& mem){
32 static_assert(
33 T::is_always_lock_free
34 , "Invalid argument size on boost::fairness::detail::notify_one"
35 );
36 mem.notify_one();
37 }
38
39 template<typename T>
40 inline void notify_all_(T& mem){
41 static_assert(
42 T::is_always_lock_free
43 , "Invalid argument size on boost::fairness::detail::notify_one"
44 );
45 mem.notify_all();
46 }
47
48}
49
50#endif // BOOST_FAIRNESS_WAIT_OPS_GENERIC_HPP
This file contains configurations about boost and 128bit cpu support. TODO.
Definition coherent_priority_lock.hpp:25
void wait_(T &mem, K expected)
Definition wait_ops_generic.hpp:22
void notify_one_(T &mem)
Definition wait_ops_generic.hpp:31
void notify_all_(T &mem)
Definition wait_ops_generic.hpp:40