Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-02-26 04:11:54 +0300
committerChristopher Faylor <me@cgf.cx>2000-02-26 04:11:54 +0300
commit8656ee07efbd5d47cde561d4ead67174970f989b (patch)
treef25b7adbe6236e9aec1b76b7eef1c18143b9a0b6 /winsup/cygwin/sync.h
parent52aaab48f491505380eca98379beccdd8b4f2570 (diff)
* exceptions.cc (interruptible): Make a little more structured.
(call_handler): Allow signals to be sent even if signalled thread is stopped. Change order of signal_arrived arming/waiting threads clearing to eliminate a race. (reset_signal_arrived): New helper function. * malloc.cc (malloc_init): Use mutos so that signal handler can keep track of who owns the lock. (__malloc_lock): Ditto. (__malloc_unlock): Ditto. * sync.h (new_muto): Actually use a muto for the "buffer". * Makefile.in: Fix a dependency.
Diffstat (limited to 'winsup/cygwin/sync.h')
-rw-r--r--winsup/cygwin/sync.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/winsup/cygwin/sync.h b/winsup/cygwin/sync.h
index 7215c2bd7..c7ada834a 100644
--- a/winsup/cygwin/sync.h
+++ b/winsup/cygwin/sync.h
@@ -28,7 +28,7 @@ public:
/* This simple constructor is used for cases where no bruteforce
event handling is required. */
- muto(): sync(0), visits(0), waiters(-1), bruteforce(0), tid(0), next (0) {;}
+ muto(): sync(0), visits(0), waiters(-1), bruteforce(0), tid(0), next (NULL) {;}
/* A more complicated constructor. */
muto(int inh, const char *name);
~muto ();
@@ -46,9 +46,9 @@ extern muto muto_start;
/* Use a statically allocated buffer as the storage for a muto */
#define new_muto(__inh, __name) \
({ \
- static NO_COPY char __mbuf[sizeof(class muto) + 100] = {0}; \
- muto *m = muto_start.next; \
- muto_start.next = new (__mbuf) muto ((__inh), (__name)); \
- muto_start.next->next = m; \
- muto_start.next; \
+ static NO_COPY muto __mbuf; \
+ (void) new ((char *) &__mbuf) muto (__inh, __name); \
+ __mbuf.next = muto_start.next; \
+ muto_start.next = &__mbuf; \
+ &__mbuf; \
})