Ticket #3960: sample.cc

File sample.cc, 365 bytes (added by gyula.gubacsi@…, 13 years ago)

Partial code

Line 
1bool
2core_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...
11void
12core_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}