Revert "smartened up the source and build organization a bit"
[beacon-ss.git] / beacon / detail / quick_wait.cpp
blobf45687e1fad7639ba0034d535056b069329008dc
1 /**
2 * beacon
3 * Author: Lukas Krejci <krejci.l@centrum.cz>, (C) 2008
4 * Copyright: See COPYING file that comes with this distribution
5 */
7 #include <beacon/detail/quick_wait.hpp>
8 #include <boost/thread.hpp>
10 namespace beacon {
12 namespace detail {
14 void wait(volatile AO_TS_t & guard) {
15 while(AO_test_and_set(&guard) == AO_TS_SET) boost::thread::yield();
18 void notify(volatile AO_TS_t & guard) {
19 AO_CLEAR(&guard);
22 } //namespace detail