| 49 | native_handler_type native_handler() { return &_rwlock; } |
| 50 | |
| 51 | void rdlock() { |
| 52 | int rc = bthread_rwlock_rdlock(&_rwlock); |
| 53 | if (rc) { |
| 54 | throw std::system_error(std::error_code(rc, std::system_category()), |
| 55 | "RWLock rdlock failed"); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | bool try_rdlock() { |
| 60 | return 0 == bthread_rwlock_tryrdlock(&_rwlock); |