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:
Diffstat (limited to 'winsup/cygwin/sync.cc')
-rw-r--r--winsup/cygwin/sync.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/winsup/cygwin/sync.cc b/winsup/cygwin/sync.cc
index f5c21594b..9f44ff264 100644
--- a/winsup/cygwin/sync.cc
+++ b/winsup/cygwin/sync.cc
@@ -125,3 +125,16 @@ muto::release ()
return 1; /* success. */
}
+
+/* Call only when we're exiting. This is not thread safe. */
+void
+muto::reset ()
+{
+ visits = sync = tid = 0;
+ InterlockedExchange (&waiters, -1);
+ if (bruteforce)
+ {
+ CloseHandle (bruteforce);
+ bruteforce = CreateEvent (&sec_none_nih, FALSE, FALSE, name);
+ }
+}