Changeset: 80b43934cb87 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=80b43934cb87
Modified Files:
gdk/gdk_system.c
Branch: Jul2015
Log Message:
Fixed concurrency problem on Windows.
Don't have two threads wait for the same finished thread.
diffs (21 lines):
diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c
--- a/gdk/gdk_system.c
+++ b/gdk/gdk_system.c
@@ -161,6 +161,7 @@ static struct winthread {
} *winthreads = NULL;
#define EXITED 1
#define DETACHED 2
+#define WAITING 4
static CRITICAL_SECTION winthread_cs;
static int winthread_cs_init = 0;
@@ -211,7 +212,8 @@ join_threads(void)
waited = 0;
EnterCriticalSection(&winthread_cs);
for (w = winthreads; w; w = w->next) {
- if ((w->flags & (EXITED | DETACHED)) == (EXITED |
DETACHED)) {
+ if ((w->flags & (EXITED | DETACHED | WAITING)) ==
(EXITED | DETACHED)) {
+ w->flags |= WAITING;
LeaveCriticalSection(&winthread_cs);
WaitForSingleObject(w->hdl, INFINITE);
CloseHandle(w->hdl);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list