* thread.h (List_remove): Make node parameter const. Use simple comparison and
assignment rather than InterlockedCompareExchangePointer since access is already synchronized.
This commit is contained in:
parent
ac5e21b028
commit
9885498829
|
@ -1,3 +1,9 @@
|
|||
2005-05-30 Vaclav Haisman <v.haisman@sh.cvut.cz>
|
||||
|
||||
* thread.h (List_remove): Make node parameter const. Use simple
|
||||
comparison and assignment rather than InterlockedCompareExchangePointer
|
||||
since access is already synchronized.
|
||||
|
||||
2005-05-30 Christopher Faylor <cgf@timesys.com>
|
||||
|
||||
* dlfcn.cc (set_dl_error): Use UNIX error rather than Windows error.
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue