Ticket #3960: sample.cc
File sample.cc, 365 bytes (added by , 13 years ago) |
---|
Line | |
---|---|
1 | bool |
2 | core_logic::is_player_there() const |
3 | { |
4 | boost::scoped_lock<boost::mutex> lock(player_mtx_); |
5 | return !ctx_.empty(); |
6 | } |
7 | |
8 | |
9 | |
10 | // This function blocks the thread... |
11 | void |
12 | core_logic::wait_for_players() |
13 | { |
14 | boost::unique_lock<boost::mutex> lock(player_mtx_); |
15 | |
16 | is_betting_done_.wait(lock, |
17 | boost::bind(&core_logic::is_player_there, this) |
18 | ); |
19 | } |