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] Thread safe stdio


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.


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