Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

completing the older cdecl fix: SHA-1: ae46f23

* cdecl missing in functions which are passed to pthread_cleanup_push(): fixed -- matches type ptw32_cleanup_callback_t this way.
  • Loading branch information...
commit b7bbdd45cb52333b5f6e6c5e481c4d4a2fdd2576 1 parent 0d12032
Ger Hobbelt authored
9 pthread_once.c
View
@@ -37,6 +37,13 @@
#include "pthread.h"
#include "implement.h"
+static void PTW32_CDECL
+ptw32_mcs_lock_cleanup(void *args)
+{
+ ptw32_mcs_local_node_t *node = (ptw32_mcs_local_node_t *)args;
+ ptw32_mcs_lock_release(node);
+}
+
int
pthread_once (pthread_once_t * once_control, void (PTW32_CDECL *init_routine) (void))
{
@@ -60,7 +67,7 @@ pthread_once (pthread_once_t * once_control, void (PTW32_CDECL *init_routine) (v
#pragma inline_depth(0)
#endif
- pthread_cleanup_push(ptw32_mcs_lock_release, &node);
+ pthread_cleanup_push(ptw32_mcs_lock_cleanup, &node);
(*init_routine)();
pthread_cleanup_pop(0);
9 tests/cancel8.c
View
@@ -98,6 +98,13 @@ static bag_t threadbag[NUMTHREADS + 1];
static pthread_cond_t CV = PTHREAD_COND_INITIALIZER;
static pthread_mutex_t CVLock = PTHREAD_MUTEX_INITIALIZER;
+static void PTW32_CDECL
+pthread_mutex_cleanup(void *args)
+{
+ pthread_mutex_t *cvl = (pthread_mutex_t *)args;
+ pthread_mutex_unlock(cvl);
+}
+
static
#if ! defined (PTW32_CONFIG_MINGW) || defined (__MSVCRT__)
unsigned __stdcall
@@ -116,7 +123,7 @@ Win32thread(void * arg)
assert(pthread_kill(bag->self, 0) == 0);
assert(pthread_mutex_lock(&CVLock) == 0);
- pthread_cleanup_push(pthread_mutex_unlock, &CVLock);
+ pthread_cleanup_push(pthread_mutex_cleanup, &CVLock);
pthread_cond_wait(&CV, &CVLock);
pthread_cleanup_pop(1);
9 tests/condvar7.c
View
@@ -110,6 +110,13 @@ static struct timespec abstime = { 0, 0 };
static int awoken;
+static void PTW32_CDECL
+pthread_mutex_cleanup(void *args)
+{
+ pthread_mutex_t *cvl = (pthread_mutex_t *)args;
+ pthread_mutex_unlock(cvl);
+}
+
static void *
mythread(void * arg)
{
@@ -128,7 +135,7 @@ mythread(void * arg)
#ifdef _MSC_VER
#pragma inline_depth(0)
#endif
- pthread_cleanup_push(pthread_mutex_unlock, (void *) &cvthing.lock);
+ pthread_cleanup_push(pthread_mutex_cleanup, (void *) &cvthing.lock);
while (! (cvthing.shared > 0))
assert(pthread_cond_timedwait(&cvthing.notbusy, &cvthing.lock, &abstime) == 0);
9 tests/condvar8.c
View
@@ -110,6 +110,13 @@ static struct timespec abstime = { 0, 0 };
static int awoken;
+static void PTW32_CDECL
+pthread_mutex_cleanup(void *args)
+{
+ pthread_mutex_t *cvl = (pthread_mutex_t *)args;
+ pthread_mutex_unlock(cvl);
+}
+
static void *
mythread(void * arg)
{
@@ -128,7 +135,7 @@ mythread(void * arg)
#ifdef _MSC_VER
#pragma inline_depth(0)
#endif
- pthread_cleanup_push(pthread_mutex_unlock, (void *) &cvthing.lock);
+ pthread_cleanup_push(pthread_mutex_cleanup, (void *) &cvthing.lock);
while (! (cvthing.shared > 0))
assert(pthread_cond_timedwait(&cvthing.notbusy, &cvthing.lock, &abstime) == 0);
9 tests/condvar9.c
View
@@ -112,6 +112,13 @@ static struct timespec abstime = { 0, 0 };
static int awoken;
+static void PTW32_CDECL
+pthread_mutex_cleanup(void *args)
+{
+ pthread_mutex_t *cvl = (pthread_mutex_t *)args;
+ pthread_mutex_unlock(cvl);
+}
+
static void *
mythread(void * arg)
{
@@ -134,7 +141,7 @@ mythread(void * arg)
#ifdef _MSC_VER
#pragma inline_depth(0)
#endif
- pthread_cleanup_push(pthread_mutex_unlock, (void *) &cvthing.lock);
+ pthread_cleanup_push(pthread_mutex_cleanup, (void *) &cvthing.lock);
while (! (cvthing.shared > 0))
assert(pthread_cond_timedwait(&cvthing.notbusy, &cvthing.lock, &abstime) == 0);
9 tests/delay2.c
View
@@ -41,6 +41,13 @@
static pthread_mutex_t mx = PTHREAD_MUTEX_INITIALIZER;
+static void PTW32_CDECL
+pthread_mutex_cleanup(void *args)
+{
+ pthread_mutex_t *cvl = (pthread_mutex_t *)args;
+ pthread_mutex_unlock(cvl);
+}
+
static void *
func(void * arg)
{
@@ -51,7 +58,7 @@ func(void * arg)
#ifdef _MSC_VER
#pragma inline_depth(0)
#endif
- pthread_cleanup_push(pthread_mutex_unlock, &mx);
+ pthread_cleanup_push(pthread_mutex_cleanup, &mx);
assert(pthread_delay_np(&interval) == 0);
pthread_cleanup_pop(1);
#ifdef _MSC_VER
2  tests/once4.c
View
@@ -72,7 +72,7 @@ static bag_t threadbag[NUM_THREADS][NUM_ONCE];
static CRITICAL_SECTION print_lock;
-static void
+static void PTW32_CDECL
mycleanupfunc(void * arg)
{
bag_t * bag = (bag_t *) arg;
Please sign in to comment.
Something went wrong with that request. Please try again.