| 332 | } |
| 333 | } |
| 334 | void lock() |
| 335 | { |
| 336 | if (m == 0) |
| 337 | { |
| 338 | boost::throw_exception( |
| 339 | boost::lock_error(static_cast<int>(system::errc::operation_not_permitted), "boost unique_lock has no mutex")); |
| 340 | } |
| 341 | if (owns_lock()) |
| 342 | { |
| 343 | boost::throw_exception( |
| 344 | boost::lock_error(static_cast<int>(system::errc::resource_deadlock_would_occur), "boost unique_lock owns already the mutex")); |
| 345 | } |
| 346 | m->lock(); |
| 347 | is_locked = true; |
| 348 | } |
| 349 | bool try_lock() |
| 350 | { |
| 351 | if (m == 0) |
no test coverage detected