MCPcopy Create free account
hub / github.com/3rdparty/libprocess / lock

Method lock

include/process/mutex.hpp:33–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 Mutex() : data(new Data()) {}
32
33 Future<Nothing> lock()
34 {
35 Future<Nothing> future = Nothing();
36
37 synchronized (data->lock) {
38 if (!data->locked) {
39 data->locked = true;
40 } else {
41 Promise<Nothing> waiter;
42 future = waiter.future();
43 data->waiters.push(std::move(waiter));
44 }
45 }
46
47 return future;
48 }
49
50 void unlock()
51 {

Callers 14

locking_functionFunction · 0.80
dyn_lock_functionFunction · 0.80
useMethod · 0.80
enable_cancellationFunction · 0.80
recv_callbackMethod · 0.80
send_callbackMethod · 0.80
event_callbackMethod · 0.80
recvMethod · 0.80
listenMethod · 0.80
pollDiscardFunction · 0.80
TESTFunction · 0.80
startMethod · 0.80

Calls 3

futureMethod · 0.80
pushMethod · 0.80
synchronizedFunction · 0.50

Tested by 1

TESTFunction · 0.64