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

Method wait_for_terminate

src/tests/process_tests.cpp:2106–2122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2104 {
2105 public:
2106 Future<Nothing> wait_for_terminate(Promise<Nothing>&& p)
2107 {
2108 p.set(Nothing()); // Notify that we're inside the function.
2109
2110 Time start = Clock::now();
2111
2112 while (Clock::now() - start < process::TEST_AWAIT_TIMEOUT) {
2113 if (eventCount<TerminateEvent>() == 1 &&
2114 eventCount<DispatchEvent>() == 1) {
2115 return Nothing();
2116 }
2117
2118 os::sleep(Milliseconds(1));
2119 }
2120
2121 return Failure("Timed out waiting for terminate and dispatch");
2122 }
2123 };
2124
2125 PID<TestProcess> process = spawn(new TestProcess(), true);

Callers

nothing calls this directly

Calls 2

FailureClass · 0.85
setMethod · 0.45

Tested by

no test coverage detected