sigcancel_handler and coverage of test cases

John Reiser jreiser@BitWagon.com
Mon Oct 9 17:33:00 GMT 2006


It would be convenient if sigcancel_handler() kept a count
of the number of times it was invoked, and provided a subroutine
to return the current value of the counter.  This would be a
fast, inexpensive, and independent check to aid in the engineering
of correctness, test coverage, and performance of code which uses
NPTL pthreads.  For example, if execution of a test suite for
code which uses pthread_cond_wait() never encounters sigcancel,
then that may be an indication that the tests are incomplete.
The Linux application supervisor "strace -f" can be used to detect
SIGRTMIN, but strace often distorts the scheduling of threads
in ways that can affect cancellation of futex operations.
The explicit use of pthread_cleanup_push() is related but
requires advance planning, and such a handler is invoked also
by direct (non-async) cancellation.

-- 



More information about the Libc-alpha mailing list