* debug.h (console_printf): Define for non-debugging condition.

* cygtls.h (_threadinfo::lock): Remove wait argument.
(_threadinfo::interrupt_setup): Remove retaddr argument.
* exceptions.cc (_threadinfo::interrupt_setup): Ditto.
(_threadinfo::interrupt_now): Accommodate change to interrupt_setup argument.
(setup_handler): Ditto.  Always lock sig stack prior to determining interrupt
method.
* gendef (_sigfe): Correct thinko regarding cmpxchg.
(_sigbe): Ditto.
(_threadinfo::lock): Ditto.
(_threadinfo::pop): Eliminate left-over stack unlock.
* sigproc.cc (proc_subproc): Chnage debugging output to printed warning.
This commit is contained in:
Christopher Faylor 2004-02-09 04:04:24 +00:00
parent 733309f576
commit cec4879206
67 changed files with 116 additions and 95 deletions

View File

@ -1,3 +1,21 @@
2004-02-08 Christopher Faylor <cgf@redhat.com>
* debug.h (console_printf): Define for non-debugging condition.
* cygtls.h (_threadinfo::lock): Remove wait argument.
(_threadinfo::interrupt_setup): Remove retaddr argument.
* exceptions.cc (_threadinfo::interrupt_setup): Ditto.
(_threadinfo::interrupt_now): Accommodate change to interrupt_setup
argument.
(setup_handler): Ditto. Always lock sig stack prior to determining
interrupt method.
* gendef (_sigfe): Correct thinko regarding cmpxchg.
(_sigbe): Ditto.
(_threadinfo::lock): Ditto.
(_threadinfo::pop): Eliminate left-over stack unlock.
* sigproc.cc (proc_subproc): Chnage debugging output to printed
warning.
2004-02-08 Christopher Faylor <cgf@redhat.com> 2004-02-08 Christopher Faylor <cgf@redhat.com>
* localtime.cc (localtime_r): Call tzset. * localtime.cc (localtime_r): Call tzset.

View File

@ -1,6 +1,6 @@
/* autoload.cc: all dynamic load stuff. /* autoload.cc: all dynamic load stuff.
Copyright 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* cygheap.cc: Cygwin heap manager. /* cygheap.cc: Cygwin heap manager.
Copyright 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* cygmalloc.h: cygwin DLL malloc stuff /* cygmalloc.h: cygwin DLL malloc stuff
Copyright 2002 Red Hat, Inc. Copyright 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* cygserver.h /* cygserver.h
Copyright 2001, 2002 Red Hat Inc. Copyright 2001, 2002, 2003, 2004 Red Hat Inc.
Written by Egor Duda <deo@logos-m.ru> Written by Egor Duda <deo@logos-m.ru>

View File

@ -1,6 +1,6 @@
/* cygserver_ipc.h /* cygserver_ipc.h
Copyright 2002, 2003 Red Hat, Inc. Copyright 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* cygthread.cc /* cygthread.cc
Copyright 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This software is a copyrighted work licensed under the terms of the This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for Cygwin license. Please consult the file "CYGWIN_LICENSE" for

View File

@ -156,7 +156,7 @@ void
_threadinfo::push (__stack_t addr, bool exception) _threadinfo::push (__stack_t addr, bool exception)
{ {
if (exception) if (exception)
lock (true); lock ();
*stackptr++ = (__stack_t) addr; *stackptr++ = (__stack_t) addr;
if (exception) if (exception)
unlock (); unlock ();

View File

@ -1,6 +1,6 @@
/* cygtls.h /* cygtls.h
Copyright 2003 Red Hat, Inc. Copyright 2003, 2004 Red Hat, Inc.
This software is a copyrighted work licensed under the terms of the This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for Cygwin license. Please consult the file "CYGWIN_LICENSE" for
@ -130,14 +130,15 @@ struct _threadinfo
void reset_exception (); void reset_exception ();
bool interrupt_now (CONTEXT *, int, void *, struct sigaction&) bool interrupt_now (CONTEXT *, int, void *, struct sigaction&)
__attribute__((regparm(3))); __attribute__((regparm(3)));
void __stdcall interrupt_setup (int sig, void *handler, struct sigaction& siga, __stack_t retaddr) void __stdcall interrupt_setup (int sig, void *handler,
struct sigaction& siga)
__attribute__((regparm(3))); __attribute__((regparm(3)));
void init_threadlist_exceptions (struct _exception_list *); void init_threadlist_exceptions (struct _exception_list *);
operator HANDLE () const {return tid->win32_obj_id;} operator HANDLE () const {return tid->win32_obj_id;}
void set_siginfo (struct sigpacket *) __attribute__ ((regparm (3))); void set_siginfo (struct sigpacket *) __attribute__ ((regparm (3)));
void set_threadkill () {threadkill = true;} void set_threadkill () {threadkill = true;}
void reset_threadkill () {threadkill = false;} void reset_threadkill () {threadkill = false;}
int lock (int wait) __attribute__ ((regparm (2))); int lock () __attribute__ ((regparm (1)));
void unlock () __attribute__ ((regparm (1))); void unlock () __attribute__ ((regparm (1)));
/*gentls_offsets*/ /*gentls_offsets*/
}; };

View File

@ -1,6 +1,6 @@
/* debug.cc /* debug.cc
Copyright 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This software is a copyrighted work licensed under the terms of the This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for Cygwin license. Please consult the file "CYGWIN_LICENSE" for

View File

@ -1,6 +1,6 @@
/* debug.h /* debug.h
Copyright 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This software is a copyrighted work licensed under the terms of the This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for Cygwin license. Please consult the file "CYGWIN_LICENSE" for
@ -38,6 +38,7 @@ details. */
# define setclexec(h, nh, b) do {} while (0) # define setclexec(h, nh, b) do {} while (0)
# define debug_fixup_after_fork_exec() do {} while (0) # define debug_fixup_after_fork_exec() do {} while (0)
# define VerifyHandle(h) do {} while (0) # define VerifyHandle(h) do {} while (0)
# define console_printf small_printf
#else #else

View File

@ -1,6 +1,6 @@
/* dlfcn.cc /* dlfcn.cc
Copyright 1998, 2000, 2001 Red Hat, Inc. Copyright 1998, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* dll_init.cc /* dll_init.cc
Copyright 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This software is a copyrighted work licensed under the terms of the This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for Cygwin license. Please consult the file "CYGWIN_LICENSE" for

View File

@ -1,6 +1,6 @@
/* dtable.cc: file descriptor support. /* dtable.cc: file descriptor support.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -693,9 +693,8 @@ interruptible (DWORD pc)
} }
void __stdcall void __stdcall
_threadinfo::interrupt_setup (int sig, void *handler, _threadinfo::interrupt_setup (int sig, void *handler,
struct sigaction& siga, __stack_t retaddr) struct sigaction& siga)
{ {
__stack_t *retaddr_in_tls = stackptr - 1;
push ((__stack_t) sigdelayed); push ((__stack_t) sigdelayed);
oldmask = myself->getsigmask (); oldmask = myself->getsigmask ();
newmask = oldmask | siga.sa_mask | SIGTOMASK (sig); newmask = oldmask | siga.sa_mask | SIGTOMASK (sig);
@ -707,8 +706,9 @@ _threadinfo::interrupt_setup (int sig, void *handler,
myself->stopsig = 0; myself->stopsig = 0;
myself->process_state |= PID_STOPPED; myself->process_state |= PID_STOPPED;
} }
this->sig = sig; // Should ALWAYS be second to last setting set to avoid a race
*retaddr_in_tls = retaddr; this->sig = sig; // Should ALWAYS be last setting set to avoid a race
/* Clear any waiting threads prior to dispatching to handler function */ /* Clear any waiting threads prior to dispatching to handler function */
int res = SetEvent (signal_arrived); // For an EINTR case int res = SetEvent (signal_arrived); // For an EINTR case
proc_subproc (PROC_CLEARWAIT, 1); proc_subproc (PROC_CLEARWAIT, 1);
@ -720,8 +720,8 @@ bool
_threadinfo::interrupt_now (CONTEXT *ctx, int sig, void *handler, _threadinfo::interrupt_now (CONTEXT *ctx, int sig, void *handler,
struct sigaction& siga) struct sigaction& siga)
{ {
push (0); push ((__stack_t) ctx->Eip);
interrupt_setup (sig, handler, siga, (__stack_t) ctx->Eip); interrupt_setup (sig, handler, siga);
ctx->Eip = pop (); ctx->Eip = pop ();
SetThreadContext (*this, ctx); /* Restart the thread in a new location */ SetThreadContext (*this, ctx); /* Restart the thread in a new location */
return 1; return 1;
@ -762,20 +762,16 @@ setup_handler (int sig, void *handler, struct sigaction& siga, _threadinfo *tls)
goto out; goto out;
} }
int locked;
for (int i = 0; i < CALL_HANDLER_RETRY; i++) for (int i = 0; i < CALL_HANDLER_RETRY; i++)
{ {
locked = tls->lock ();
__stack_t *retaddr_on_stack = tls->stackptr - 1; __stack_t *retaddr_on_stack = tls->stackptr - 1;
if (retaddr_on_stack >= tls->stack) if (retaddr_on_stack >= tls->stack)
{ {
if (!tls->lock (false))
continue;
__stack_t retaddr = InterlockedExchange ((LONG *) retaddr_on_stack, 0);
if (!retaddr)
continue;
tls->reset_exception (); tls->reset_exception ();
tls->interrupt_setup (sig, handler, siga, retaddr); tls->interrupt_setup (sig, handler, siga);
sigproc_printf ("interrupted known cygwin routine"); sigproc_printf ("interrupted known cygwin routine");
tls->unlock ();
interrupted = true; interrupted = true;
break; break;
} }
@ -826,11 +822,15 @@ setup_handler (int sig, void *handler, struct sigaction& siga, _threadinfo *tls)
if (interrupted) if (interrupted)
break; break;
tls->unlock ();
locked = false;
sigproc_printf ("couldn't interrupt. trying again."); sigproc_printf ("couldn't interrupt. trying again.");
low_priority_sleep (0); low_priority_sleep (0);
} }
out: out:
if (locked)
tls->unlock ();
sigproc_printf ("signal %d %sdelivered", sig, interrupted ? "" : "not "); sigproc_printf ("signal %d %sdelivered", sig, interrupted ? "" : "not ");
return interrupted; return interrupted;
} }

View File

@ -1,6 +1,6 @@
/* external.cc: Interface to Cygwin internals from external programs. /* external.cc: Interface to Cygwin internals from external programs.
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Written by Christopher Faylor <cgf@cygnus.com> Written by Christopher Faylor <cgf@cygnus.com>

View File

@ -1,6 +1,6 @@
/* fhandler.cc. See console.cc for fhandler_console functions. /* fhandler.cc. See console.cc for fhandler_console functions.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* fhandler.h /* fhandler.h
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* fhandler_dev_clipboard: code to access /dev/clipboard /* fhandler_dev_clipboard: code to access /dev/clipboard
Copyright 2000, 2001, 2002, 2003 Red Hat, Inc Copyright 2000, 2001, 2002, 2003, 2004 Red Hat, Inc
Written by Charles Wilson (cwilson@ece.gatech.edu) Written by Charles Wilson (cwilson@ece.gatech.edu)

View File

@ -1,6 +1,6 @@
/* fhandler_console.cc /* fhandler_console.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* fhandler_disk_file.cc /* fhandler_disk_file.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* fhandler_dev_dsp: code to emulate OSS sound model /dev/dsp /* fhandler_dev_dsp: code to emulate OSS sound model /dev/dsp
Copyright 2001, 2002, 2003 Red Hat, Inc Copyright 2001, 2002, 2003, 2004 Red Hat, Inc
Written by Andy Younger (andy@snoogie.demon.co.uk) Written by Andy Younger (andy@snoogie.demon.co.uk)

View File

@ -1,6 +1,6 @@
/* fhandler_fifo.cc. See fhandler.h for a description of the fhandler classes. /* fhandler_fifo.cc. See fhandler.h for a description of the fhandler classes.
Copyright 2002, 2003 Red Hat, Inc. Copyright 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,7 +1,7 @@
/* fhandler_floppy.cc. See fhandler.h for a description of the /* fhandler_floppy.cc. See fhandler.h for a description of the
fhandler classes. fhandler classes.
Copyright 1999, 2000, 2001, 2002 Red Hat, Inc. Copyright 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* fhandler_mem.cc. See fhandler.h for a description of the fhandler classes. /* fhandler_mem.cc. See fhandler.h for a description of the fhandler classes.
Copyright 2000, 2001, 2002 Red Hat, Inc. Copyright 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* fhandler.cc. See console.cc for fhandler_console functions. /* fhandler.cc. See console.cc for fhandler_console functions.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* fhandler_proc.cc: fhandler for /proc virtual filesystem /* fhandler_proc.cc: fhandler for /proc virtual filesystem
Copyright 2002, 2003 Red Hat, Inc. Copyright 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* fhandler_process.cc: fhandler for /proc/<pid> virtual filesystem /* fhandler_process.cc: fhandler for /proc/<pid> virtual filesystem
Copyright 2002, 2003 Red Hat, Inc. Copyright 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* fhandler_random.cc: code to access /dev/random and /dev/urandom /* fhandler_random.cc: code to access /dev/random and /dev/urandom
Copyright 2000, 2001, 2002 Red Hat, Inc. Copyright 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Written by Corinna Vinschen (vinschen@cygnus.com) Written by Corinna Vinschen (vinschen@cygnus.com)

View File

@ -1,6 +1,6 @@
/* fhandler_raw.cc. See fhandler.h for a description of the fhandler classes. /* fhandler_raw.cc. See fhandler.h for a description of the fhandler classes.
Copyright 1999, 2000, 2001, 2002 Red Hat, Inc. Copyright 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* fhandler_registry.cc: fhandler for /proc/registry virtual filesystem /* fhandler_registry.cc: fhandler for /proc/registry virtual filesystem
Copyright 2002, 2003 Red Hat, Inc. Copyright 2002, 2003, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* fhandler_serial.cc /* fhandler_serial.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* fhandler_socket.cc. See fhandler.h for a description of the fhandler classes. /* fhandler_socket.cc. See fhandler.h for a description of the fhandler classes.
Copyright 2000, 2001, 2002 Red Hat, Inc. Copyright 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,7 +1,7 @@
/* fhandler_tape.cc. See fhandler.h for a description of the fhandler /* fhandler_tape.cc. See fhandler.h for a description of the fhandler
classes. classes.
Copyright 1999, 2000, 2001, 2002 Red Hat, Inc. Copyright 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* fhandler_termios.cc /* fhandler_termios.cc
Copyright 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* fhandler_virtual.cc: base fhandler class for virtual filesystems /* fhandler_virtual.cc: base fhandler class for virtual filesystems
Copyright 2002 Red Hat, Inc. Copyright 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* fhandler_windows.cc: code to access windows message queues. /* fhandler_windows.cc: code to access windows message queues.
Copyright 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Written by Sergey S. Okhapkin (sos@prospect.com.ru). Written by Sergey S. Okhapkin (sos@prospect.com.ru).
Feedback and testing by Andy Piper (andyp@parallax.co.uk). Feedback and testing by Andy Piper (andyp@parallax.co.uk).

View File

@ -1,6 +1,6 @@
/* fhandler_dev_zero.cc: code to access /dev/zero /* fhandler_dev_zero.cc: code to access /dev/zero
Copyright 2000, 2001, 2002 Red Hat, Inc. Copyright 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Written by DJ Delorie (dj@cygnus.com) Written by DJ Delorie (dj@cygnus.com)

View File

@ -94,8 +94,9 @@ __sigfe:
pushl %edx pushl %edx
movl %fs:4,%edx movl %fs:4,%edx
1: movl \$1,%eax 1: movl \$1,%eax
lock cmpxchg %eax,$tls::stacklock(%edx) lock xchgl %eax,$tls::stacklock(%edx)
jne 2f cmpl %eax,%eax
jz 2f
xorl %eax,%eax xorl %eax,%eax
call _low_priority_sleep call _low_priority_sleep
jmp 1b jmp 1b
@ -103,7 +104,7 @@ __sigfe:
xadd %eax,$tls::stackptr(%edx) xadd %eax,$tls::stackptr(%edx)
decl $tls::stacklock(%edx) decl $tls::stacklock(%edx)
leal __sigbe,%edx leal __sigbe,%edx
xchg %edx,8(%esp) xchgl %edx,8(%esp)
movl %edx,(%eax) movl %edx,(%eax)
popl %edx popl %edx
ret ret
@ -115,15 +116,17 @@ __sigbe:
pushl %eax pushl %eax
movl %fs:4,%edx movl %fs:4,%edx
1: movl \$1,%eax 1: movl \$1,%eax
lock cmpxchg %eax,$tls::stacklock(%edx) lock xchgl %eax,$tls::stacklock(%edx)
jne 2f cmpl %eax,%eax
jz 2f
xorl %eax,%eax xorl %eax,%eax
call _low_priority_sleep call _low_priority_sleep
jmp 1b jmp 1b
2: movl \$-4,%eax 2: movl \$-4,%eax
xadd %eax,$tls::stackptr(%edx) xadd %eax,$tls::stackptr(%edx)
xchg %edx,-4(%eax) decl $tls::stacklock(%edx)
xchg %edx,4(%esp) xchgl %edx,-4(%eax)
xchgl %edx,4(%esp)
popl %eax popl %eax
ret ret
@ -134,19 +137,17 @@ __ZN11_threadinfo3popEv:
movl \$-4,%ebx movl \$-4,%ebx
xadd %ebx,$tls::pstackptr(%edx) xadd %ebx,$tls::pstackptr(%edx)
xorl %eax,%eax xorl %eax,%eax
xchg %eax,-4(%ebx) xchgl %eax,-4(%ebx)
decl $tls::pstacklock(%edx)
popl %ebx popl %ebx
ret ret
.global __ZN11_threadinfo4lockEi .global __ZN11_threadinfo4lockEv
__ZN11_threadinfo4lockEi: __ZN11_threadinfo4lockEv:
pushl %ebx pushl %ebx
movl %eax,%ebx movl %eax,%ebx
1: movl \$1,%eax 1: movl \$1,%eax
lock cmpxchg %eax,$tls::pstacklock(%ebx) lock xchgl %eax,$tls::pstacklock(%ebx)
jne 2f cmpl %eax,%eax
cmpl %edx,%edx
jz 2f jz 2f
xorl %eax,%eax xorl %eax,%eax
call _low_priority_sleep call _low_priority_sleep

View File

@ -1,6 +1,6 @@
/* heap.cc: Cygwin heap manager. /* heap.cc: Cygwin heap manager.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* malloc_wrapper.cc /* malloc_wrapper.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Originally written by Steve Chamberlain of Cygnus Support Originally written by Steve Chamberlain of Cygnus Support
sac@cygnus.com sac@cygnus.com

View File

@ -1,6 +1,6 @@
/* mmap.cc /* mmap.cc
Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* net.cc: network-related routines. /* net.cc: network-related routines.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* perthread.h: Header file for cygwin thread-local storage. /* perthread.h: Header file for cygwin thread-local storage.
Copyright 2000, 2001, 2002, 2004 Red Hat, Inc. Copyright 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Written by Christopher Faylor <cgf@cygnus.com> Written by Christopher Faylor <cgf@cygnus.com>

View File

@ -1,6 +1,6 @@
/* pinfo.cc: process table support /* pinfo.cc: process table support
Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* pipe.cc: pipe for Cygwin. /* pipe.cc: pipe for Cygwin.
Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* sec_acl.cc: Sun compatible ACL functions. /* sec_acl.cc: Sun compatible ACL functions.
Copyright 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Written by Corinna Vinschen <corinna@vinschen.de> Written by Corinna Vinschen <corinna@vinschen.de>

View File

@ -1,6 +1,6 @@
/* sec_helper.cc: NT security helper functions /* sec_helper.cc: NT security helper functions
Copyright 2000, 2001, 2002 Red Hat, Inc. Copyright 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Written by Corinna Vinschen <corinna@vinschen.de> Written by Corinna Vinschen <corinna@vinschen.de>

View File

@ -1,6 +1,6 @@
/* security.cc: NT security functions /* security.cc: NT security functions
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Originaly written by Gunther Ebert, gunther.ebert@ixos-leipzig.de Originaly written by Gunther Ebert, gunther.ebert@ixos-leipzig.de
Completely rewritten by Corinna Vinschen <corinna@vinschen.de> Completely rewritten by Corinna Vinschen <corinna@vinschen.de>

View File

@ -1,6 +1,6 @@
/* security.h: security declarations /* security.h: security declarations
Copyright 2000, 2001, 2002 Red Hat, Inc. Copyright 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* select.cc /* select.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Written by Christopher Faylor of Cygnus Solutions Written by Christopher Faylor of Cygnus Solutions
cgf@cygnus.com cgf@cygnus.com

View File

@ -1,6 +1,6 @@
/* select.h /* select.h
Copyright 1998, 1999, 2000, 2001, 2004 Red Hat, Inc. Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* signal.cc /* signal.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Written by Steve Chamberlain of Cygnus Support, sac@cygnus.com Written by Steve Chamberlain of Cygnus Support, sac@cygnus.com
Significant changes by Sergey Okhapkin <sos@prospect.com.ru> Significant changes by Sergey Okhapkin <sos@prospect.com.ru>

View File

@ -125,10 +125,10 @@ Static HANDLE wait_sig_inited; // Control synchronization of
*/ */
Static HANDLE events[PSIZE + 1]; // All my children's handles++ Static HANDLE events[PSIZE + 1]; // All my children's handles++
#define hchildren (events + 1) // Where the children handles begin #define hchildren (events + 1) // Where the children handles begin
Static char cpchildren[PSIZE * sizeof (pinfo)]; // All my children info
Static int nchildren; // Number of active children Static int nchildren; // Number of active children
Static char czombies[(NZOMBIES + 1) * sizeof (pinfo)]; // All my deceased children info Static char cpchildren[PSIZE * sizeof (pinfo)]; // All my children info
Static int nzombies; // Number of deceased children Static int nzombies; // Number of deceased children
Static char czombies[(NZOMBIES + 1) * sizeof (pinfo)]; // All my deceased children info
#define pchildren ((pinfo *) cpchildren) #define pchildren ((pinfo *) cpchildren)
#define zombies ((pinfo *) czombies) #define zombies ((pinfo *) czombies)
@ -378,7 +378,7 @@ proc_subproc (DWORD what, DWORD val)
way to deal with this and could lead to process hangs. */ way to deal with this and could lead to process hangs. */
if (nzombies >= NZOMBIES) if (nzombies >= NZOMBIES)
{ {
sigproc_printf ("zombie table overflow %d", thiszombie); system_printf ("zombie table overflow %d", thiszombie);
remove_zombie (thiszombie); remove_zombie (thiszombie);
} }

View File

@ -1,6 +1,6 @@
/* spawn.cc /* spawn.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -4,7 +4,7 @@
which is intended to operate similarly to a mutex but attempts to which is intended to operate similarly to a mutex but attempts to
avoid making expensive calls to the kernel. avoid making expensive calls to the kernel.
Copyright 2000, 2001, 2002 Red Hat, Inc. Copyright 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Written by Christopher Faylor <cgf@cygnus.com> Written by Christopher Faylor <cgf@cygnus.com>

View File

@ -1,6 +1,6 @@
/* sync.h: Header file for cygwin synchronization primitives. /* sync.h: Header file for cygwin synchronization primitives.
Copyright 1999, 2000, 2001, 2002 Red Hat, Inc. Copyright 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Written by Christopher Faylor <cgf@cygnus.com> Written by Christopher Faylor <cgf@cygnus.com>

View File

@ -1,6 +1,6 @@
/* syscalls.cc: syscalls /* syscalls.cc: syscalls
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* sysconf.cc /* sysconf.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* thread.cc: Locking and threading module functions /* thread.cc: Locking and threading module functions
Copyright 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Originally written by Marco Fuykschot <marco@ddi.nl> Originally written by Marco Fuykschot <marco@ddi.nl>
Substantialy enhanced by Robert Collins <rbtcollins@hotmail.com> Substantialy enhanced by Robert Collins <rbtcollins@hotmail.com>

View File

@ -1,6 +1,6 @@
/* thread.h: Locking and threading module definitions /* thread.h: Locking and threading module definitions
Copyright 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Written by Marco Fuykschot <marco@ddi.nl> Written by Marco Fuykschot <marco@ddi.nl>
Major update 2001 Robert Collins <rbtcollins@hotmail.com> Major update 2001 Robert Collins <rbtcollins@hotmail.com>

View File

@ -1,6 +1,6 @@
/* uinfo.cc: user info (uid, gid, etc...) /* uinfo.cc: user info (uid, gid, etc...)
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* wait.cc: Posix wait routines. /* wait.cc: Posix wait routines.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,7 +1,7 @@
/* wincap.cc -- figure out on which OS we're running. Set the /* wincap.cc -- figure out on which OS we're running. Set the
capability class to the appropriate values. capability class to the appropriate values.
Copyright 2001, 2002 Red Hat, Inc. Copyright 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* wincap.h: Header for OS capability class. /* wincap.h: Header for OS capability class.
Copyright 2001, 2002 Red Hat, Inc. Copyright 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* window.cc: hidden windows for signals/itimer support /* window.cc: hidden windows for signals/itimer support
Copyright 1997, 1998, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1997, 1998, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
Written by Sergey Okhapkin <sos@prospect.com.ru> Written by Sergey Okhapkin <sos@prospect.com.ru>

View File

@ -1,6 +1,6 @@
/* winsup.h: main Cygwin header file. /* winsup.h: main Cygwin header file.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.