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

Function sigusr1_handler

tools/streamer_recorder/ProtonectSR.cpp:68–79  ·  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

66//everything above is thread safe when calling start()/stop() while
67//waitForNewFrame().
68void sigusr1_handler(int s)
69{
70 if (devtopause == 0)
71 return;
72/// [pause]
73 if (protonect_paused)
74 devtopause->start();
75 else
76 devtopause->stop();
77 protonect_paused = !protonect_paused;
78/// [pause]
79}
80
81//The following demostrates how to create a custom logger
82/// [logger]

Callers

nothing calls this directly

Calls 2

startMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected