This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Fix gethwnd race


On Thu, 6 May 2004, Christopher Faylor wrote:

> Thanks, but, I see that you're using busy loops.  I use those in places
> where I have no choice but to do so or when the potential for a race is
> unlikely.
>
> I don't think that this is really a situation that qualifies for either.
> It seems like a muto is a cleaner choice here.

Sorry for the delay; my free time has been in short supply lately.

I can't seem to make a muto fit this situation cleanly since it would have
to be acquired and released by the same thread.  Maybe I missed something
obvious, but I think the attached patch addresses the root of your
objection to the previous patch.

2004-05-13  Brian Ford  <ford@vss.fsi.com>

	* window.cc (window_started): Make NO_COPY.
	(gethwnd): Fix initialization race.
	(window_init): New function to initialize window_started.
	* winsup.h (window_init): Prototype it.
	* dcrt0.cc (dll_crt0_1): Call it.

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained pilot...

Attachment: gethwnd_blocking.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]