diff options
-rw-r--r-- | src/vcl/vcl_locked.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vcl/vcl_locked.c b/src/vcl/vcl_locked.c index bae1c0d86b3..f8a306c1ba1 100644 --- a/src/vcl/vcl_locked.c +++ b/src/vcl/vcl_locked.c @@ -301,11 +301,18 @@ vls_mt_add (void) } else vcl_set_worker_index (vlsl->vls_wrk_index); + + /* Only allow new pthread to be cancled in vls_mt_mq_lock */ + int old_state; + if (vlsl->vls_mt_n_threads >= 2) + pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &old_state); } static inline void vls_mt_mq_lock (void) { + /* Allow controlled cancelation of thread before grabbing mutex */ + pthread_testcancel (); pthread_mutex_lock (&vlsl->vls_mt_mq_mlock); } |