summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/thread.h')
-rw-r--r--winsup/cygwin/thread.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h
index be2ada6bc..e0535033b 100644
--- a/winsup/cygwin/thread.h
+++ b/winsup/cygwin/thread.h
@@ -136,14 +136,16 @@ List_insert (list_node *&head, list_node *node)
}
template <class list_node> inline void
-List_remove (fast_mutex &mx, list_node *&head, list_node *node)
+List_remove (fast_mutex &mx, list_node *&head, list_node const *node)
{
if (!node)
return;
mx.lock ();
if (head)
{
- if (InterlockedCompareExchangePointer (&head, node->next, node) != node)
+ if (head == node)
+ head = head->next;
+ else
{
list_node *cur = head;