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 Fri, May 14, 2004 at 10:59:42AM -0500, Brian Ford wrote:
>> However, I'll look at your code again with my new understanding of your
>> intent.
>
>No need.  Just before falling a sleep last night, I remembered a case I
>had not covered correctly.  If the initialization fails the first time,
>the event is not reset.  Can this just be a fatal condition?

I think it should be, yes.  Otherwise, you just have cascading failures
and the thing that eventually causes cygwin to crash may not be the root
cause of the problem.

>I'll cook up a muto based solution in the next few minutes now
>that I understand your preference.  But, I'd like an opinion on the
>question above.

Thanks very much for the offer, but please don't bother.  I took this
opportunity to do some of the cleanup that I was talking about.  I also
implemented a "close handle on final use" option to mutos so that the
event doesn't stay around after the final thread releases it.

I need to do a little debugging on what I have but it does try to clean
up the windows code slightly.  I even eliminated the thread event
synchronization entirely.

Btw, a muto is supposed to be equivalent to a windows mutex in most
respects except that it is supposed to be somewhat lighter weight.

cgf


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