__THROW and cancellation points

Michael Deutschmann michael at talamasca.ocis.net
Mon Mar 17 13:47:12 UTC 2008


In uClibc's header files many functions are marked with a comment to the
effect of "this function doesn't have __THROW because it is or could be
a cancellation point".

Rather than repeat this comment ad nauseam (since very many functions
are in this class), I suggest it would be cleaner to define a no-op
"__THROW_CP" macro to use for these functions.  Then the comment can
occur once at the definition of __THROW_CP.

This would also offer a practical advantage, since cancellation points
are only an issue with threading.  __THROW_CP would only need to be a
no-op in a threaded build of uClibc.  For no-thread builds, it could be
defined identical to __THROW, so that non-threaded users can gain the
optimization benefits of correct __THROW declarations more often.

---- Michael Deutschmann <michael at talamasca.ocis.net>



More information about the uClibc mailing list