diff options
author | rpj <rpj> | 2004-05-17 01:38:02 +0000 |
---|---|---|
committer | rpj <rpj> | 2004-05-17 01:38:02 +0000 |
commit | 771465fed0cf50ee2dd790723245fc091699c324 (patch) | |
tree | d8c18d095a33fe7c4564bd90c5f313bb9e4057dd /ptw32_callUserDestroyRoutines.c | |
parent | 8b14911744f58cbe3730703f3fcc41cd969fd0f3 (diff) |
re-indentation, bug fixes, hooks for pre-emptive async cancelation
Diffstat (limited to 'ptw32_callUserDestroyRoutines.c')
-rw-r--r-- | ptw32_callUserDestroyRoutines.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/ptw32_callUserDestroyRoutines.c b/ptw32_callUserDestroyRoutines.c index 8f19be1..90b0b73 100644 --- a/ptw32_callUserDestroyRoutines.c +++ b/ptw32_callUserDestroyRoutines.c @@ -39,8 +39,9 @@ #include "implement.h" #ifdef __cplusplus -# if ! defined (_MSC_VER) && ! (defined(__GNUC__) && __GNUC__ < 3) - using std::terminate; +# if ! defined (_MSC_VER) && ! (defined(__GNUC__) && __GNUC__ < 3) && ! defined(__WATCOMC__) +using + std::terminate; # endif #endif @@ -55,16 +56,18 @@ ptw32_callUserDestroyRoutines (pthread_t thread) * It simulates the behaviour of POSIX Threads. * * PARAMETERS - * thread - * an instance of pthread_t + * thread + * an instance of pthread_t * * RETURNS - * N/A + * N/A * ------------------------------------------------------------------- */ { - ThreadKeyAssoc **nextP; - ThreadKeyAssoc *assoc; + ThreadKeyAssoc ** + nextP; + ThreadKeyAssoc * + assoc; if (thread != NULL) { @@ -87,7 +90,8 @@ ptw32_callUserDestroyRoutines (pthread_t thread) if (pthread_mutex_lock (&(assoc->lock)) == 0) { - pthread_key_t k; + pthread_key_t + k; if ((k = assoc->key) != NULL) { /* @@ -97,7 +101,8 @@ ptw32_callUserDestroyRoutines (pthread_t thread) * key is valid and we can call the destroy * routine; */ - void *value = NULL; + void * + value = NULL; value = pthread_getspecific (k); if (value != NULL && k->destructor != NULL) @@ -123,15 +128,15 @@ ptw32_callUserDestroyRoutines (pthread_t thread) * should not get any internal pthreads * exceptions. */ - terminate(); + terminate (); } -#else /* __cplusplus */ +#else /* __cplusplus */ - /* - * Run the caller's cleanup routine. - */ - (*(k->destructor)) (value); + /* + * Run the caller's cleanup routine. + */ + (*(k->destructor)) (value); #endif /* __cplusplus */ } |