Re: pgsql: Add putenv support for msvcrt from Visual Studio 2013 - Mailing list pgsql-committers

From Christian Ullrich
Subject Re: pgsql: Add putenv support for msvcrt from Visual Studio 2013
Date
Msg-id b1c08e36-5a8e-cc0a-d49e-a9a571ecfc0a@chrullrich.net
Whole thread Raw
In response to Re: pgsql: Add putenv support for msvcrt from Visual Studio 2013  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-committers
* Michael Paquier wrote:

> On Tue, Sep 6, 2016 at 5:36 PM, Christian Ullrich <chris@chrullrich.net> wrote:
>> * Michael Paquier wrote:

>>> In order to avoid any problems with the load and unload windows, my
>>> bet goes for 0001, 0002 and 0003, with the last two patches merged
>>> together, 0001 being only a set of independent fixes. That's ugly, but
>>> that looks the safest course of actions. I have rebased/rewritten the
>>> patches as attached. Thoughts?
>>
>> In lieu of convincing you to drop the entire thing, yes, that looks about
>> right, except for the BOOL thing.
>
> Yes, right. Thanks. Patch 0001 is definitely something that should be
> applied and backpatched, the CloseHandle() call is buggy. Now 0002 and
> 0003 are improving things, but there have been no reports regarding
> problems in this area, so this could just be applied to master I
> guess. Christian, does that sound right?

Yes.

> By the way, how is it decided that a DLL gets unloaded in a process if
> it is not pinned? Is that something the OS decides?

Reference counting in LoadLibrary() and FreeLibrary(), among other
places. For example, GetModuleHandleEx() (but not the non-Ex) will by
default increment the counter.

--
Christian


pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pgsql: Add putenv support for msvcrt from Visual Studio 2013
Next
From: Simon Riggs
Date:
Subject: pgsql: Fix VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL