MCPcopy Create free account
hub / github.com/apache/brpc / Mutex

Method Mutex

src/bthread/mutex.h:49–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47public:
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() {

Callers

nothing calls this directly

Calls 1

bthread_mutex_initFunction · 0.85

Tested by

no test coverage detected