Recent changes in pthread_create

Christopher Faylor cgf-no-personal-reply-please@cygwin.com
Wed Apr 21 14:54:00 GMT 2004


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



More information about the Cygwin-patches mailing list