Re: [PATCHES] Compiling libpq with VisualC

Поиск
Список
Период
Сортировка
От Manfred Spraul
Тема Re: [PATCHES] Compiling libpq with VisualC
Дата
Msg-id 40CD3875.3070005@colorfullife.com
обсуждение исходный текст
Ответ на Re: [PATCHES] Compiling libpq with VisualC  (pgsql@mohawksoft.com)
Список pgsql-hackers
pgsql@mohawksoft.com wrote:

>>
>>What is the recommended way to create mutex objects (CreateMutex) from
>>Win32 libraries?  There must be a clean way like there is in pthreads.
>>
>>
>
>A mutex is inherently a global object. CreateMutex(NULL, FALSE, NULL) will
>return a handle to an unowned mutex.
>
>
>
That's not the problem. Under pthread, it's possible to initialize a
mutex from compile time:

    static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;

This means that the mutex is immediately valid, no races with the
initialization. I couldn't find an equivalent Win32 feature.

--
    Manfred

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: I just got it: PostgreSQL Application Server -- a
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: File leak?