X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fplatform%2Fwindows%2Fos-threads.h;h=f696ff798717bc304a91ebf9cdd17ed6f52db98e;hb=6acb9c0bfd389f1ad4d052582b27a1a395322135;hp=47101dcd0c5326c610546351c747da747f7360bc;hpb=ab3793869529cd444e745143c0aa781f6adcf0a0;p=deb_libcec.git diff --git a/src/lib/platform/windows/os-threads.h b/src/lib/platform/windows/os-threads.h index 47101dc..f696ff7 100644 --- a/src/lib/platform/windows/os-threads.h +++ b/src/lib/platform/windows/os-threads.h @@ -31,6 +31,8 @@ * http://www.pulse-eight.net/ */ +#include + namespace PLATFORM { #define thread_t HANDLE @@ -41,7 +43,7 @@ namespace PLATFORM typedef CRITICAL_SECTION* mutex_t; #define MutexCreate(mutex) ::InitializeCriticalSection(mutex = new CRITICAL_SECTION) #define MutexDelete(mutex) ::DeleteCriticalSection(mutex); delete mutex - #define MutexLock(mutex) ::EnterCriticalSection(mutex) + inline bool MutexLock(mutex_t mutex) {::EnterCriticalSection(mutex); return true; } #define MutexTryLock(mutex) (::TryEnterCriticalSection(mutex) != 0) #define MutexUnlock(mutex) ::LeaveCriticalSection(mutex)