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


Thomas,

IMHO, include/cygwin/_types.h should be created before the below patch is
applied, to provide continuity (otherwise the builds will be broken
between the two patches).  Creating it earlier does no harm, AFAICS.  The
rest of the Cygwin patch should obviously wait.
	Igor

On Wed, 11 Feb 2004, Thomas Pfaff wrote:

_flock_t is now defined in cygwin/_types.h. I will sent following patch
for newlib when this one is applied:

--- _types.h.org	2004-01-26 23:33:11.000000000 +0100
+++ _types.h	2004-02-10 12:28:44.359443200 +0100
@@ -9,6 +9,10 @@
  #ifndef	_SYS__TYPES_H
  #define _SYS__TYPES_H

+#ifdef __CYGWIN__
+#include <cygwin/_types.h>
+#endif
+
  typedef long _off_t;
  __extension__ typedef long long _off64_t;

@@ -32,7 +36,9 @@ typedef struct
    } __value;		/* Value so far.  */
  } _mbstate_t;

+#ifndef __CYGWIN__
  typedef int _flock_t;
+#endif

  /* Iconv descriptor type */
  typedef void *_iconv_t;


The __sinit call must be done after malloc is initialized, otherwise the mutex creation will fail.

Thomas

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.

-- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha@cs.nyu.edu ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton


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