MCPcopy Create free account
hub / github.com/apache/mesos / put

Method put

3rdparty/libprocess/include/process/queue.hpp:35–54  ·  view source on GitHub ↗

TODO(bmahler): Take a T&& here instead.

Source from the content-addressed store, hash-verified

33
34 // TODO(bmahler): Take a T&& here instead.
35 void put(const T& t)
36 {
37 // NOTE: We need to grab the promise 'date->promises.front()' but
38 // set it outside of the critical section because setting it might
39 // trigger callbacks that try to reacquire the lock.
40 Owned<Promise<T>> promise;
41
42 synchronized (data->lock) {
43 if (data->promises.empty()) {
44 data->elements.push(t);
45 } else {
46 promise = data->promises.front();
47 data->promises.pop_front();
48 }
49 }
50
51 if (promise.get() != nullptr) {
52 promise->set(t);
53 }
54 }
55
56 Future<T> get()
57 {

Callers 11

foreachFunction · 0.45
serveFunction · 0.45
runMethod · 0.45
reapMethod · 0.45
listenMethod · 0.45
accept_callbackMethod · 0.45
acceptMethod · 0.45
TESTFunction · 0.45
TEST_PFunction · 0.45
TESTFunction · 0.45

Calls 5

pushMethod · 0.80
synchronizedFunction · 0.50
emptyMethod · 0.45
getMethod · 0.45
setMethod · 0.45

Tested by 3

TESTFunction · 0.36
TEST_PFunction · 0.36
TESTFunction · 0.36