| 23 | static bool pong_requested = false; |
| 24 | |
| 25 | void *thread_main(void *arg) { |
| 26 | std::cout << "running thread ..." << std::endl; |
| 27 | |
| 28 | std::unique_lock<std::mutex> lock(mutex); |
| 29 | while (!pong_requested) |
| 30 | cond_var.wait(lock); |
| 31 | pong = now(); // Measure time in the pthread |
| 32 | std::cout << "pong - ping: " << (pong - ping) << std::endl; |
| 33 | pong_requested = false; |
| 34 | cond_var.notify_one(); |
| 35 | |
| 36 | return NULL; |
| 37 | } |
| 38 | |
| 39 | EMSCRIPTEN_KEEPALIVE |
| 40 | extern "C" int notify() { |
nothing calls this directly
no test coverage detected