Re: [PATCHES] Compiling libpq with VisualC

From: Manfred Spraul <manfred(at)colorfullife(dot)com>
To: pgsql(at)mohawksoft(dot)com
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Andreas Pflug <pgadmin(at)pse-consulting(dot)de>, PostgreSQL Win32 port list <pgsql-hackers-win32(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] Compiling libpq with VisualC
Date: 2004-06-14 05:32:37
Message-ID: 40CD3875.3070005@colorfullife.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32 pgsql-patches

pgsql(at)mohawksoft(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2004-06-14 06:21:34 Re: File leak?
Previous Message Joshua D. Drake 2004-06-14 03:50:40 Re: I just got it: PostgreSQL Application Server -- a

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Magnus Hagander 2004-06-14 07:41:57 Re: Installer
Previous Message Bruce Momjian 2004-06-13 23:57:18 Re: [pgsql-hackers-win32] [PATCHES] Compiling libpq with VisualC

Browse pgsql-patches by date

  From Date Subject
Next Message Gary Doades 2004-06-14 17:59:34 Re: [HACKERS] [PATCHES] Compiling libpq with VisualC
Previous Message Tom Lane 2004-06-14 00:10:50 Re: [PATCHES] Configuration patch