pthreads - pthread_cancel when using mutexes an conditional variables -



pthreads - pthread_cancel when using mutexes an conditional variables -

hello have question cancelling thread uses mutexes , conditional variables. thread has cancel type deferred. when utilize functions pthread_mutex_lock/unlock , pthread_cond_wait, , cancel request arrives, thread's cancelation point pthread_cond_wait. lock mutex or not? not sure, if thread leaves mutex unlock. or pthread_mutex_lock/unlock functions cancellation points? give thanks you.

i uncertainty can phrase improve the documentation:

a status wait (whether timed or not) cancellation point. when cancelability type of thread set pthread_cancel_deferred, side effect of acting upon cancellation request while in status wait mutex (in effect) re-acquired before calling first cancellation cleanup handler. effect if thread unblocked, allowed execute point of returning phone call pthread_cond_timedwait() or pthread_cond_wait(), @ point notices cancellation request , instead of returning caller of pthread_cond_timedwait() or pthread_cond_wait(), starts thread cancellation activities, includes calling cancellation cleanup handlers.

also sure aware other functions cancellation points well.

pthreads

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -