This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
sigcancel_handler and coverage of test cases
- From: John Reiser <jreiser at BitWagon dot com>
- To: libc-alpha at sourceware dot org
- Date: Mon, 09 Oct 2006 10:33:10 -0700
- Subject: sigcancel_handler and coverage of test cases
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.
--