From 907dc7d0c9f64d95b6d4da91dab6601d0e6054ec Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 14 Feb 2002 21:20:06 +0000 Subject: * exceptions.cc (unused_sig_wrapper): Eliminate unused parameter to asm. * external.cc (cygwin_internal): Change CW_STRACE_ON to CW_STRACE_TOGGLE. * strace.cc (strace::hello): Toggle strace on and off. * sync.cc (muto::init): Renamed from constructor. * sync.h (muto::new): Delete. (muto::delete): Ditto. (new_muto): Simplify. Use muto.init for nearly everything. * uinfo.cc (uinfo_init): Avoid closing a NULL handle. * include/sys/cygwin.h (cygwin_getinfo_types): Rename CW_STRACE_OFF to CW_STRACE_TOGGLE. Delete CW_STRACE_OFF. * include/sys/strace.h (strace): Add "inited" field. --- winsup/cygwin/sync.h | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'winsup/cygwin/sync.h') diff --git a/winsup/cygwin/sync.h b/winsup/cygwin/sync.h index d546b71e5..756503d86 100644 --- a/winsup/cygwin/sync.h +++ b/winsup/cygwin/sync.h @@ -23,17 +23,13 @@ public: class muto *next; const char *name; - muto() {} /* The real constructor. */ - muto(int inh, const char *name); + muto *init(int inh, const char *name) __attribute__ ((regparm (3))); - void *operator new (size_t, void *p) {return p;} - void *operator new (size_t) {return ::new muto; } - void operator delete (void *) {;} /* can't handle allocated mutos - currently */ - - ~muto (); - int acquire (DWORD ms = INFINITE) __attribute__ ((regparm(1))); /* Acquire the lock. */ +#if 0 /* FIXME: See comment in sync.cc */ + ~muto () +#endif + int acquire (DWORD ms = INFINITE) __attribute__ ((regparm (1))); /* Acquire the lock. */ int release (); /* Release the lock. */ /* Return true if caller thread owns the lock. */ @@ -48,9 +44,6 @@ extern muto muto_start; /* Use a statically allocated buffer as the storage for a muto */ #define new_muto(__inh, __name) \ ({ \ - static volatile __attribute__((section(".data_cygwin_nocopy"))) muto __mbuf; \ - (void) new ((void *) &__mbuf) muto (__inh, __name); \ - __mbuf.next = muto_start.next; \ - muto_start.next = (muto *) &__mbuf; \ - (muto *) &__mbuf; \ + static muto __mbuf __attribute__((section(".data_cygwin_nocopy"))); \ + __mbuf.init (__inh, __name); \ }) -- cgit v1.2.3