We are developing a kernel driver and corresponding test cases (in user land) and used timers in our code. Malloc
is almost not available. Timers are set up by SIGEV_THREAD
so new threads are created.
According to the instructions here and here, it is hard to implement a general clean up system. So I am trying to define a framework with coding rules to deal with this.
In this method, I need to count the number of running handlers of a specific timer. In kernel, I can use try_to_del_timer_sync()
and re-add to achieve this, but I cannot find a method in userland, especially POSIX
.
Linux-specific methods are also welcome.