| 264 | } |
| 265 | |
| 266 | void lock() |
| 267 | { |
| 268 | #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS |
| 269 | boost::this_thread::disable_interruption do_not_disturb; |
| 270 | #endif |
| 271 | boost::unique_lock<boost::mutex> lk(state_change); |
| 272 | state.exclusive_waiting_blocked=true; |
| 273 | exclusive_cond.wait(lk, boost::bind(&state_data::can_lock, boost::ref(state))); |
| 274 | state.exclusive=true; |
| 275 | } |
| 276 | |
| 277 | #if defined BOOST_THREAD_USES_DATETIME |
| 278 | bool timed_lock(system_time const& timeout) |