This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: [PATCH] Thread safe stdio
- From: Christopher Faylor <cgf-no-personal-reply-please at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Wed, 11 Feb 2004 10:01:04 -0500
- Subject: Re: [PATCH] Thread safe stdio
- References: <4029FF39.9080806@gmx.net>
- Reply-to: cygwin-patches at cygwin dot com
On Wed, Feb 11, 2004 at 11:08:57AM +0100, Thomas Pfaff wrote:
>The __sinit call must be done after malloc is initialized, otherwise the
>mutex creation will fail.
I am not comfortable with this part of the patch. I moved the __sinit
call where I did for a reason. It needed to be called earlier in the
process. I'm also somewhat uncomfortable with using malloc for this
purpose in general. It seems like a heavyweight solution to something
that could be solved with either a muto or a critical section.
>2004-02-11 Thomas Pfaff <tpfaff@gmx.net>
>
> * include/cygwin/_types.h: New file.
> * include/sys/lock.h: Ditto.
> * include/sys/stdio.h: Ditto.
> * dcrt0.cc (dll_crt0_1): Add __sinit call after malloc
> initialization.
> (_dll_crt0): Remove __sinit call.
> * thread.cc: Include sys/lock.h
> (__cygwin_lock_init): New function.
> (__cygwin_lock_init_recursive): Ditto.
> (__cygwin_lock_fini): Ditto.
> (__cygwin_lock_lock): Ditto.
> (__cygwin_lock_unlock): Ditto.