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

Method once

include/process/once.hpp:36–52  ·  view source on GitHub ↗

Returns true if this Once instance has already transitioned to a 'done' state (i.e., the action you wanted to perform "once" has been completed). Note that this BLOCKS until Once::done has been called.

Source from the content-addressed store, hash-verified

34 // been completed). Note that this BLOCKS until Once::done has been
35 // called.
36 bool once()
37 {
38 bool result = false;
39
40 synchronized (mutex) {
41 if (started) {
42 while (!finished) {
43 synchronized_wait(&cond, &mutex);
44 }
45 result = true;
46 } else {
47 started = true;
48 }
49 }
50
51 return result;
52 }
53
54 // Transitions this Once instance to a 'done' state.
55 void done()

Callers 4

reinitializeFunction · 0.80
initializeFunction · 0.80
initializeMethod · 0.80
initializeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected