Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2012-10-23 14:17:29 +0400
committerCorinna Vinschen <corinna@vinschen.de>2012-10-23 14:17:29 +0400
commita94555ec0f78ebd0a5a315211e3d44f6b6e77df5 (patch)
tree13230061e1712ba15b59c0c91bc523dce41a98cf
parentcdc5dd85f143b905bda94cdc2b165407c483947a (diff)
* thread.h (List_insert): Cast first parameter in
InterlockedCompareExchangePointer call to avoid compiler warnings. (List_remove): Ditto.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/thread.h18
2 files changed, 16 insertions, 8 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index ad74f7ea0..9a8c4380e 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2012-10-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * thread.h (List_insert): Cast first parameter in
+ InterlockedCompareExchangePointer call to avoid compiler warnings.
+ (List_remove): Ditto.
+
2012-10-22 Corinna Vinschen <corinna@vinschen.de>
* winbase.h: Remove.
diff --git a/winsup/cygwin/thread.h b/winsup/cygwin/thread.h
index 07652758c..a0412e1d0 100644
--- a/winsup/cygwin/thread.h
+++ b/winsup/cygwin/thread.h
@@ -59,18 +59,18 @@ public:
void lock ()
{
- if (InterlockedIncrement ((long *) &lock_counter) != 1)
+ if (InterlockedIncrement (&lock_counter) != 1)
cygwait (win32_obj_id, cw_infinite, cw_sig);
}
void unlock ()
{
- if (InterlockedDecrement ((long *) &lock_counter))
+ if (InterlockedDecrement (&lock_counter))
::SetEvent (win32_obj_id);
}
private:
- unsigned long lock_counter;
+ LONG lock_counter;
HANDLE win32_obj_id;
};
@@ -119,18 +119,20 @@ List_insert (list_node *&head, list_node *node)
return;
do
node->next = head;
- while (InterlockedCompareExchangePointer (&head, node, node->next) != node->next);
+ while (InterlockedCompareExchangePointer ((PVOID volatile *) &head,
+ node, node->next) != node->next);
}
template <class list_node> inline void
-List_remove (fast_mutex &mx, list_node *&head, list_node const *node)
+List_remove (fast_mutex &mx, list_node *&head, list_node *node)
{
if (!node)
return;
mx.lock ();
if (head)
{
- if (InterlockedCompareExchangePointer (&head, node->next, node) != node)
+ if (InterlockedCompareExchangePointer ((PVOID volatile *) &head,
+ node->next, node) != node)
{
list_node *cur = head;
@@ -297,7 +299,7 @@ public:
}
protected:
- unsigned long lock_counter;
+ LONG lock_counter;
HANDLE win32_obj_id;
pthread_t owner;
#ifdef DEBUGGING
@@ -680,7 +682,7 @@ struct MTinterface
{
// General
int concurrency;
- long int threadcount;
+ LONG threadcount;
callback *pthread_prepare;
callback *pthread_child;