diff options
author | Christopher Faylor <me@cgf.cx> | 2005-05-30 18:37:41 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-05-30 18:37:41 +0000 |
commit | 98854988296f67186dac563cf114239e3feb8455 (patch) | |
tree | 499e7caa55e0dda89c5fd9ba91a974d4c0da2b64 /winsup/cygwin | |
parent | ac5e21b028491e4ed03aa606113c97cea27a0b53 (diff) | |
download | cygnal-98854988296f67186dac563cf114239e3feb8455.tar.gz cygnal-98854988296f67186dac563cf114239e3feb8455.tar.bz2 cygnal-98854988296f67186dac563cf114239e3feb8455.zip |
* thread.h (List_remove): Make node parameter const. Use simple comparison and
assignment rather than InterlockedCompareExchangePointer since access is
already synchronized.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/thread.h | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 4e0e50751..924a907aa 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -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. 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; |