projects
/
mono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b0e63a8
)
[threadpool-ms] Fix race condition
author
Ludovic Henry
<ludovic.henry@xamarin.com>
Thu, 23 Apr 2015 19:47:26 +0000
(20:47 +0100)
committer
Ludovic Henry
<ludovic.henry@xamarin.com>
Thu, 23 Apr 2015 19:47:26 +0000
(20:47 +0100)
mono/metadata/threadpool-ms.c
patch
|
blob
|
history
diff --git
a/mono/metadata/threadpool-ms.c
b/mono/metadata/threadpool-ms.c
index 66689009ffec2643014e6ba37226ddef646b685f..6038160548e7f09e345a87183369cdf555988ad5 100644
(file)
--- a/
mono/metadata/threadpool-ms.c
+++ b/
mono/metadata/threadpool-ms.c
@@
-757,7
+757,7
@@
monitor_should_keep_running (void)
if (InterlockedExchange (&monitor_status, MONITOR_STATUS_WAITING_FOR_REQUEST) == MONITOR_STATUS_WAITING_FOR_REQUEST) {
if (mono_runtime_is_shutting_down () || !domain_any_has_request ()) {
- if (Interlocked
Exchange (&monitor_status, MONITOR_STATUS_NOT_RUNNING
) == MONITOR_STATUS_WAITING_FOR_REQUEST)
+ if (Interlocked
CompareExchange (&monitor_status, MONITOR_STATUS_NOT_RUNNING, MONITOR_STATUS_WAITING_FOR_REQUEST
) == MONITOR_STATUS_WAITING_FOR_REQUEST)
return FALSE;
}
}