* cygheap.cc (cygheap_init): Born again function.

(_cmalloc): Reorganize to accomodate muto locking.
(_cfree): Use muto lock to avoid multi-thread problems.
* cygheap.h (incygheap): Just use cygheap_max to find upper cygwin heap bounds.
* dcrt0.cc (dll_crt0_1): Reinstitute cygheap_init call.
* path.cc (getcwd): Just return cwdstuff::get result, allowing correct handling
of negative length.
(cwdstuff::get): Malloc a buffer if one is not available.
This commit is contained in:
Christopher Faylor
2000-10-02 02:26:04 +00:00
parent 0ce83ef6b8
commit 9fc09d00f7
7 changed files with 60 additions and 44 deletions

View File

@@ -116,7 +116,7 @@ muto::release ()
if (!--visits)
{
tid = 0; /* We were the last unlocker. */
InterlockedExchange (&sync, 0); /* Reset trigger. */
(void) InterlockedExchange (&sync, 0); /* Reset trigger. */
/* This thread had incremented waiters but had never decremented it.
Decrement it now. If it is >= 0 then there are possibly other
threads waiting for the lock, so trigger bruteforce. */