October 2018
Beginner
794 pages
19h 23m
English
As a simple code example, let's modify our earlier refactored program—ch16/mt_iobif_rfct.c by installing a thread-cleanup handler routine. To test it, we cancel the first worker thread if the user passes 1 as the second parameter to our demo program, the ch16/cleanup_hdlr.c. program.
Here is the cleanup handler function and the re-worked wrapper routine – now with the cleanup handler push and pop APIs:
static void cleanup_handler(void *arg){ printf("+++ In %s +++\n" ...Read now
Unlock full access