Re: [PATCH 1/1] MSVC: port pthread code to native Windows threads
- From
Michael Wookey <michaelwookey@gmail.com>
- Date
- Nov 4, 2009, 08:48 UTC
- Message-ID
- <d2e97e800911040048h42ef7193v117773cc528b2361@mail.gmail.com>
- In-Reply-To
- <4AF13819.7050306@viscovery.net>
2009/11/4 Johannes Sixt <j.sixt@viscovery.net>:
Show 11 quoted lines
> Andrzej K. Haczewski schrieb:
>
>> +static __inline int win32_cond_init(win32_cond_t *cond)
>> +{
>> + cond->waiters = 0;
>> +
>> + InitializeCriticalSection(&cond->waiters_lock);
>> +
>> + cond->sema = CreateSemaphore(NULL, 0, LONG_MAX, NULL);
>
> Wouldn't an Event object be lighter-weight? (I'm only guessing.)Both events and semaphores resolve to wait-able kernel objects; so neither is "lighter-weight" than the other.