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: Recent changes in pthread_create


On Wed, Apr 21, 2004 at 10:44:57AM -0400, Christopher Faylor wrote:
>On Wed, Apr 21, 2004 at 09:18:11AM +0200, Thomas Pfaff wrote:
>>Date: Thu, 18 Apr 2002 12:11:26 +0200
>>[...]
>>2. The InterlockedIncrement (&MT_INTERFACE->threadcount) in
>>  __pthread_create is misplaced. If the newly created thread terminates
>>  fast enough the threadcount will be decremented before it was
>>  incremented, which will result in an exit from __pthread_exit instead
>>  of an ExitThread.
>>[... ]
>>
>>Same thing will now happen again after your change from CREATE_SUSPENDED to
>>0 in CreateThread.
>
>This was not just a simple change of CREATE_SUSPENDED to 0.
>
>I moved the mutex lock to prevent the thread from terminating before
>pthread::create exits.

Or, more correctly, before pthread::create is finished incrementing the
threadcount.

cgf


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