| 47 | public: |
| 48 | typedef bthread_mutex_t* native_handler_type; |
| 49 | Mutex() { |
| 50 | int ec = bthread_mutex_init(&_mutex, NULL); |
| 51 | if (ec != 0) { |
| 52 | throw std::system_error(std::error_code(ec, std::system_category()), |
| 53 | "Mutex constructor failed"); |
| 54 | } |
| 55 | } |
| 56 | ~Mutex() { CHECK_EQ(0, bthread_mutex_destroy(&_mutex)); } |
| 57 | native_handler_type native_handler() { return &_mutex; } |
| 58 | void lock() { |
nothing calls this directly
no test coverage detected