Commit Graph

7 Commits

Author SHA1 Message Date
nathanw 6d30f1a3db Disable cancellation on the first lock, too, not just on internal
recursive locks (Duh).

Disable cancellation around the cond_wait() call, since that's also a
cancellation point. Arguably, that would be better handled with
pthread_cleanup_*(), but stubbing those for libc is difficult, and the
current non-exception-based implementation of cleanup handlers is
probably no faster than disabling and reenabling cancellation.
Finally, it only happens in the slow path where the thread is going to
sleep anyway...
2003-07-22 00:56:25 +00:00
nathanw 5a5cd67fff Set the _LOCKINTERNAL() count on initial locking as well as subsequent
recursive locks.
2003-07-21 22:24:47 +00:00
nathanw d3ebb21ecd Use threadlib stub rather than pthread_setcancelstate() directly. 2003-07-19 05:06:16 +00:00
nathanw ad09d62fcc Move guts of flockfile()/funlockfile() to __flockfile_internal(), which
takes an additional argument indicating whether this is an internal caller
taking the lock or an external (application) caller. When making an internal
lock, save the current thread cancellation state and disable cancellation
until the matching unlock. This should prevent canccelled threads from exiting
inside of stdio while holding a file lock and potentially leaving other
parts of the FILE structure in an inconsistent state.
2003-07-18 21:50:41 +00:00
nathanw 34c915eb3d Revert the conversion to libpthread's recursive mutexes. Too much
trouble is caused by the memory allocation in the mutex initialization,
and uncontested mutexes and condition variables have become faster in the
meantime.
2003-02-01 03:25:00 +00:00
nathanw 6003a24dd4 Use recursive mutexes from libpthread rather than implementing
our own with normal mutexes and condition variables.
2003-01-21 23:26:02 +00:00
thorpej 3fdac2b8c5 Merge the nathanw_sa branch. 2003-01-18 10:52:16 +00:00