MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / sigusr1_handler

Function sigusr1_handler

examples/Protonect.cpp:60–71  ·  view source on GitHub ↗

Doing non-trivial things in signal handler is bad. If you want to pause, do it in another thread. Though libusb operations are generally thread safe, I cannot guarantee everything above is thread safe when calling start()/stop() while waitForNewFrame().

Source from the content-addressed store, hash-verified

58//everything above is thread safe when calling start()/stop() while
59//waitForNewFrame().
60void sigusr1_handler(int s)
61{
62 if (devtopause == 0)
63 return;
64/// [pause]
65 if (protonect_paused)
66 devtopause->start();
67 else
68 devtopause->stop();
69 protonect_paused = !protonect_paused;
70/// [pause]
71}
72
73//The following demostrates how to create a custom logger
74/// [logger]

Callers

nothing calls this directly

Calls 2

startMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected