jenny-cheung opened a new issue #352:
URL: https://github.com/apache/celix/issues/352


   Dear Developers:
                First, thank you for your checking!  I found a potential error 
in the below code. Should the lock mutex be locked and then unlocked? Potential 
errors such as data race, deadlock may be triggered.
   
   
https://github.com/apache/celix/blob/0729c4dfaa6b45f436e41f13ebe71960c746d109/bundles/remote_services/civetweb/src/civetweb.c#L1762
   
   ```
   static int pthread_cond_timedwait(pthread_cond_t *cv, pthread_mutex_t 
*mutex, const struct timespec * abstime)
   {
          ...;
   
       pthread_mutex_unlock(mutex);  // here
       ok = (WAIT_OBJECT_0 == 
WaitForSingleObject(tls->pthread_cond_helper_mutex, mswaitrel));
       pthread_mutex_lock(mutex);  //here
   
       return ok ? 0 : -1;
   }
   ```
   
   Best,


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to