Hi everyone,

A few days ago I've learned that the Linux version of oc_mutex_lock is 
currently deadlocking if the current thread already owns the same lock.

Some of the problems related to that behavior:

1. The Windows version of oc_mutex supports recursive-acquire. Having 
consistent lock behavior across all platforms supported by IoTivity allows us 
to leverage each other's testing in a more consistent way.

2. Disabling oc_mutex recursivity on Windows would entail designing an 
IoTivity-specific lock - because the locks provided by the OS support recursion.

3. We've encountered these self-deadlocks for IOT-1861 and IOT-1488.

So, I propose enabling the PTHREAD_MUTEX_RECURSIVE attribute for the Posix 
implementation of oc_mutex. Is everyone OK with this plan? I uploaded this code 
change in https://gerrit.iotivity.org/gerrit/#/c/17507/.

Thanks,
Dan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20170227/f5b2c6ba/attachment.html>

Reply via email to