| 141 | } |
| 142 | |
| 143 | void thread_base::lock() { |
| 144 | try { |
| 145 | thread_lock.lock(); |
| 146 | thread_lock_count++; |
| 147 | } catch(system_error& sys_err) { |
| 148 | cout << "unable to lock thread: " << sys_err.code() << ": " << sys_err.what() << endl; |
| 149 | } catch(...) { |
| 150 | cout << "unable to lock thread" << endl; |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | bool thread_base::try_lock() { |
| 155 | try { |
no test coverage detected