On segunda-feira, 27 de fevereiro de 2017 07:57:18 PST Daniel Mihai via 
iotivity-dev wrote:
> 2. Disabling oc_mutex recursivity on Windows would entail designing an
> IoTivity-specific lock - because the locks provided by the OS support
> recursion.

Why not a CRITICAL_SECTION?

If not, a simple event (CreateEvent) will solve this. Unlocking is a SetEvent 
and locking is WaitForSingleObjectEx.

I've also got a Win8+ implementation of a mostly-userspace mutex using 
WaitOnAddress / WakeByAddressSingle I could contribute. It's in 
https://codereview.qt-project.org/#/c/157030/8/src/corelib/thread/
qmutex_win.cpp, but since I wrote it all, Intel retains the copyright and I 
can contribute to IoTivity under the Apache licence.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

Reply via email to