projects
/
mono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7d688f1
)
The shutdown check is racy, we should check if the queue has been cleaned up instead.
author
Rodrigo Kumpera
<kumpera@gmail.com>
Fri, 17 Jan 2014 23:13:57 +0000
(18:13 -0500)
committer
Rodrigo Kumpera
<kumpera@gmail.com>
Fri, 17 Jan 2014 23:13:57 +0000
(18:13 -0500)
mono/metadata/threadpool.c
patch
|
blob
|
history
diff --git
a/mono/metadata/threadpool.c
b/mono/metadata/threadpool.c
index 8710dafd661e8d26ac41f99ec451bd617400a474..6d0996e444ae93f529fcb6ec567e7c5cf8eb9a94 100644
(file)
--- a/
mono/metadata/threadpool.c
+++ b/
mono/metadata/threadpool.c
@@
-1300,9
+1300,10
@@
try_steal (MonoWSQ *local_wsq, gpointer *data, gboolean retry)
static gboolean
dequeue_or_steal (ThreadPool *tp, gpointer *data, MonoWSQ *local_wsq)
{
- if (mono_runtime_is_shutting_down ())
+ MonoCQ *queue = tp->queue;
+ if (mono_runtime_is_shutting_down () || !queue)
return FALSE;
- mono_cq_dequeue (
tp->
queue, (MonoObject **) data);
+ mono_cq_dequeue (queue, (MonoObject **) data);
if (!tp->is_io && !*data)
try_steal (local_wsq, data, FALSE);
return (*data != NULL);