|
@@ -84,43 +84,41 @@ int starpu_pthread_mutex_destroy(starpu_pthread_mutex_t *mutex)
|
|
|
|
|
|
int starpu_pthread_mutex_lock(starpu_pthread_mutex_t *mutex)
|
|
int starpu_pthread_mutex_lock(starpu_pthread_mutex_t *mutex)
|
|
{
|
|
{
|
|
- const char *file;
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
|
|
+ const char *file;
|
|
|
|
+ file = strrchr(__FILE__,'/');
|
|
file += sizeof(char);
|
|
file += sizeof(char);
|
|
- _STARPU_TRACE_LOCKING_MUTEX(file,__LINE__);
|
|
|
|
|
|
+
|
|
|
|
+ _STARPU_TRACE_LOCKING_MUTEX(file,__LINE__);
|
|
|
|
|
|
if (!*mutex) STARPU_PTHREAD_MUTEX_INIT(mutex, NULL);
|
|
if (!*mutex) STARPU_PTHREAD_MUTEX_INIT(mutex, NULL);
|
|
-
|
|
|
|
|
|
+
|
|
xbt_mutex_acquire(*mutex);
|
|
xbt_mutex_acquire(*mutex);
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_MUTEX_LOCKED(file,__LINE__);
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ _STARPU_TRACE_MUTEX_LOCKED(file,__LINE__);
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
int starpu_pthread_mutex_unlock(starpu_pthread_mutex_t *mutex)
|
|
int starpu_pthread_mutex_unlock(starpu_pthread_mutex_t *mutex)
|
|
{
|
|
{
|
|
- const char *file;
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
|
|
+ const char *file;
|
|
|
|
+ file = strrchr(__FILE__,'/');
|
|
file += sizeof(char);
|
|
file += sizeof(char);
|
|
- _STARPU_TRACE_UNLOCKING_MUTEX(file,__LINE__);
|
|
|
|
|
|
+ _STARPU_TRACE_UNLOCKING_MUTEX(file,__LINE__);
|
|
|
|
|
|
xbt_mutex_release(*mutex);
|
|
xbt_mutex_release(*mutex);
|
|
-
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_MUTEX_UNLOCKED(file,__LINE__);
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ _STARPU_TRACE_MUTEX_UNLOCKED(file,__LINE__);
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
int starpu_pthread_mutex_trylock(starpu_pthread_mutex_t *mutex)
|
|
int starpu_pthread_mutex_trylock(starpu_pthread_mutex_t *mutex)
|
|
{
|
|
{
|
|
- const char *file;
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
|
|
+ const char *file;
|
|
|
|
+ file = strrchr(__FILE__,'/');
|
|
file += sizeof(char);
|
|
file += sizeof(char);
|
|
- _STARPU_TRACE_TRYLOCK_MUTEX(file,__LINE__);
|
|
|
|
|
|
+ _STARPU_TRACE_TRYLOCK_MUTEX(file,__LINE__);
|
|
|
|
|
|
xbt_mutex_acquire(*mutex);
|
|
xbt_mutex_acquire(*mutex);
|
|
return 0;
|
|
return 0;
|
|
@@ -187,19 +185,17 @@ int starpu_pthread_cond_broadcast(starpu_pthread_cond_t *cond)
|
|
|
|
|
|
int starpu_pthread_cond_wait(starpu_pthread_cond_t *cond, starpu_pthread_mutex_t *mutex)
|
|
int starpu_pthread_cond_wait(starpu_pthread_cond_t *cond, starpu_pthread_mutex_t *mutex)
|
|
{
|
|
{
|
|
- const char* file;
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_COND_WAIT_BEGIN(file,__LINE__);
|
|
|
|
|
|
+ const char* file;
|
|
|
|
+ file = strrchr(__FILE__,'/');
|
|
|
|
+ file += sizeof(char);
|
|
|
|
+ _STARPU_TRACE_COND_WAIT_BEGIN(file,__LINE__);
|
|
|
|
|
|
if (!*cond)
|
|
if (!*cond)
|
|
STARPU_PTHREAD_COND_INIT(cond, NULL);
|
|
STARPU_PTHREAD_COND_INIT(cond, NULL);
|
|
xbt_cond_wait(*cond, *mutex);
|
|
xbt_cond_wait(*cond, *mutex);
|
|
-
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_COND_WAIT_END(file,__LINE__);
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ _STARPU_TRACE_COND_WAIT_END(file,__LINE__);
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -222,49 +218,43 @@ int starpu_pthread_rwlock_destroy(starpu_pthread_rwlock_t *rwlock)
|
|
|
|
|
|
int starpu_pthread_rwlock_rdlock(starpu_pthread_rwlock_t *rwlock)
|
|
int starpu_pthread_rwlock_rdlock(starpu_pthread_rwlock_t *rwlock)
|
|
{
|
|
{
|
|
- const char* file;
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_RDLOCKING_RWLOCK(file,__LINE__);
|
|
|
|
|
|
+ const char* file;
|
|
|
|
+ file = strrchr(__FILE__,'/');
|
|
|
|
+ file += sizeof(char);
|
|
|
|
+ _STARPU_TRACE_RDLOCKING_RWLOCK(file,__LINE__);
|
|
|
|
|
|
int p_ret = starpu_pthread_mutex_lock(rwlock);
|
|
int p_ret = starpu_pthread_mutex_lock(rwlock);
|
|
-
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_RWLOCK_RDLOCKED(file,__LINE__);
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ _STARPU_TRACE_RWLOCK_RDLOCKED(file,__LINE__);
|
|
|
|
+
|
|
return p_ret;
|
|
return p_ret;
|
|
}
|
|
}
|
|
|
|
|
|
int starpu_pthread_rwlock_wrlock(starpu_pthread_rwlock_t *rwlock)
|
|
int starpu_pthread_rwlock_wrlock(starpu_pthread_rwlock_t *rwlock)
|
|
{
|
|
{
|
|
- const char* file;
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_WRLOCKING_RWLOCK(file,__LINE__);
|
|
|
|
|
|
+ const char* file;
|
|
|
|
+ file = strrchr(__FILE__,'/');
|
|
|
|
+ file += sizeof(char);
|
|
|
|
+ _STARPU_TRACE_WRLOCKING_RWLOCK(file,__LINE__);
|
|
|
|
|
|
int p_ret = starpu_pthread_mutex_lock(rwlock);
|
|
int p_ret = starpu_pthread_mutex_lock(rwlock);
|
|
-
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_RWLOCK_WRLOCKED(file,__LINE__);
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ _STARPU_TRACE_RWLOCK_WRLOCKED(file,__LINE__);
|
|
|
|
+
|
|
return p_ret;
|
|
return p_ret;
|
|
}
|
|
}
|
|
|
|
|
|
int starpu_pthread_rwlock_unlock(starpu_pthread_rwlock_t *rwlock)
|
|
int starpu_pthread_rwlock_unlock(starpu_pthread_rwlock_t *rwlock)
|
|
{
|
|
{
|
|
- const char* file;
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_UNLOCKING_RWLOCK(file,__LINE__);
|
|
|
|
-
|
|
|
|
|
|
+ const char* file;
|
|
|
|
+ file = strrchr(__FILE__,'/');
|
|
|
|
+ file += sizeof(char);
|
|
|
|
+ _STARPU_TRACE_UNLOCKING_RWLOCK(file,__LINE__);
|
|
|
|
+
|
|
int p_ret = starpu_pthread_mutex_unlock(rwlock);
|
|
int p_ret = starpu_pthread_mutex_unlock(rwlock);
|
|
-
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_RWLOCK_UNLOCKED(file,__LINE__);
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ _STARPU_TRACE_RWLOCK_UNLOCKED(file,__LINE__);
|
|
|
|
+
|
|
return p_ret;
|
|
return p_ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -272,108 +262,95 @@ int starpu_pthread_rwlock_unlock(starpu_pthread_rwlock_t *rwlock)
|
|
|
|
|
|
int starpu_pthread_mutex_lock(starpu_pthread_mutex_t *mutex)
|
|
int starpu_pthread_mutex_lock(starpu_pthread_mutex_t *mutex)
|
|
{
|
|
{
|
|
- const char *file;
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
|
|
+ const char *file;
|
|
|
|
+ file = strrchr(__FILE__,'/');
|
|
file += sizeof(char);
|
|
file += sizeof(char);
|
|
- _STARPU_TRACE_LOCKING_MUTEX(file,__LINE__);
|
|
|
|
|
|
+ _STARPU_TRACE_LOCKING_MUTEX(file,__LINE__);
|
|
|
|
|
|
- pthread_mutex_lock(mutex);
|
|
|
|
|
|
+ int p_ret = pthread_mutex_lock(mutex);
|
|
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_MUTEX_LOCKED(file,__LINE__);
|
|
|
|
|
|
+ _STARPU_TRACE_MUTEX_LOCKED(file,__LINE__);
|
|
|
|
|
|
- return 0;
|
|
|
|
|
|
+ return p_ret;
|
|
}
|
|
}
|
|
|
|
|
|
int starpu_pthread_mutex_unlock(starpu_pthread_mutex_t *mutex)
|
|
int starpu_pthread_mutex_unlock(starpu_pthread_mutex_t *mutex)
|
|
{
|
|
{
|
|
- const char *file;
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
|
|
+ const char *file;
|
|
|
|
+ file = strrchr(__FILE__,'/');
|
|
file += sizeof(char);
|
|
file += sizeof(char);
|
|
- _STARPU_TRACE_UNLOCKING_MUTEX(file,__LINE__);
|
|
|
|
|
|
+ _STARPU_TRACE_UNLOCKING_MUTEX(file,__LINE__);
|
|
|
|
|
|
- pthread_mutex_unlock(mutex);
|
|
|
|
|
|
+ int p_ret = pthread_mutex_unlock(mutex);
|
|
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_MUTEX_UNLOCKED(file,__LINE__);
|
|
|
|
|
|
+ _STARPU_TRACE_MUTEX_UNLOCKED(file,__LINE__);
|
|
|
|
|
|
- return 0;
|
|
|
|
|
|
+ return p_ret;
|
|
}
|
|
}
|
|
|
|
|
|
int starpu_pthread_mutex_trylock(starpu_pthread_mutex_t *mutex)
|
|
int starpu_pthread_mutex_trylock(starpu_pthread_mutex_t *mutex)
|
|
{
|
|
{
|
|
- const char *file;
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
|
|
+ const char *file;
|
|
|
|
+ file = strrchr(__FILE__,'/');
|
|
file += sizeof(char);
|
|
file += sizeof(char);
|
|
- _STARPU_TRACE_LOCKING_MUTEX(file,__LINE__);
|
|
|
|
|
|
+ _STARPU_TRACE_LOCKING_MUTEX(file,__LINE__);
|
|
|
|
|
|
- pthread_mutex_trylock(mutex);
|
|
|
|
- return 0;
|
|
|
|
|
|
+ return pthread_mutex_trylock(mutex);
|
|
}
|
|
}
|
|
|
|
|
|
int starpu_pthread_cond_wait(starpu_pthread_cond_t *cond, starpu_pthread_mutex_t *mutex)
|
|
int starpu_pthread_cond_wait(starpu_pthread_cond_t *cond, starpu_pthread_mutex_t *mutex)
|
|
{
|
|
{
|
|
- const char* file;
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_COND_WAIT_BEGIN(file,__LINE__);
|
|
|
|
|
|
+ const char* file;
|
|
|
|
+ file = strrchr(__FILE__,'/');
|
|
|
|
+ file += sizeof(char);
|
|
|
|
+ _STARPU_TRACE_COND_WAIT_BEGIN(file,__LINE__);
|
|
|
|
|
|
- pthread_cond_wait(cond, mutex);
|
|
|
|
|
|
+ int p_ret = pthread_cond_wait(cond, mutex);
|
|
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_COND_WAIT_END(file,__LINE__);
|
|
|
|
|
|
+ _STARPU_TRACE_COND_WAIT_END(file,__LINE__);
|
|
|
|
|
|
- return 0;
|
|
|
|
|
|
+ return p_ret;
|
|
}
|
|
}
|
|
|
|
|
|
int starpu_pthread_rwlock_rdlock(starpu_pthread_rwlock_t *rwlock)
|
|
int starpu_pthread_rwlock_rdlock(starpu_pthread_rwlock_t *rwlock)
|
|
{
|
|
{
|
|
- const char* file;
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_RDLOCKING_RWLOCK(file,__LINE__);
|
|
|
|
|
|
+ const char* file;
|
|
|
|
+ file = strrchr(__FILE__,'/');
|
|
|
|
+ file += sizeof(char);
|
|
|
|
+ _STARPU_TRACE_RDLOCKING_RWLOCK(file,__LINE__);
|
|
|
|
|
|
int p_ret = pthread_rwlock_rdlock(rwlock);
|
|
int p_ret = pthread_rwlock_rdlock(rwlock);
|
|
-
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_RWLOCK_RDLOCKED(file,__LINE__);
|
|
|
|
|
|
+
|
|
|
|
+ _STARPU_TRACE_RWLOCK_RDLOCKED(file,__LINE__);
|
|
|
|
|
|
return p_ret;
|
|
return p_ret;
|
|
}
|
|
}
|
|
|
|
|
|
int starpu_pthread_rwlock_wrlock(starpu_pthread_rwlock_t *rwlock)
|
|
int starpu_pthread_rwlock_wrlock(starpu_pthread_rwlock_t *rwlock)
|
|
{
|
|
{
|
|
- const char* file;
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_WRLOCKING_RWLOCK(file,__LINE__);
|
|
|
|
|
|
+ const char* file;
|
|
|
|
+ file = strrchr(__FILE__,'/');
|
|
|
|
+ file += sizeof(char);
|
|
|
|
+ _STARPU_TRACE_WRLOCKING_RWLOCK(file,__LINE__);
|
|
|
|
|
|
int p_ret = pthread_rwlock_wrlock(rwlock);
|
|
int p_ret = pthread_rwlock_wrlock(rwlock);
|
|
-
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_RWLOCK_WRLOCKED(file,__LINE__);
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ _STARPU_TRACE_RWLOCK_WRLOCKED(file,__LINE__);
|
|
|
|
+
|
|
return p_ret;
|
|
return p_ret;
|
|
}
|
|
}
|
|
|
|
|
|
int starpu_pthread_rwlock_unlock(starpu_pthread_rwlock_t *rwlock)
|
|
int starpu_pthread_rwlock_unlock(starpu_pthread_rwlock_t *rwlock)
|
|
{
|
|
{
|
|
- const char* file;
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_UNLOCKING_RWLOCK(file,__LINE__);
|
|
|
|
|
|
+ const char* file;
|
|
|
|
+ file = strrchr(__FILE__,'/');
|
|
|
|
+ file += sizeof(char);
|
|
|
|
+ _STARPU_TRACE_UNLOCKING_RWLOCK(file,__LINE__);
|
|
|
|
|
|
int p_ret = pthread_rwlock_unlock(rwlock);
|
|
int p_ret = pthread_rwlock_unlock(rwlock);
|
|
-
|
|
|
|
- file = strrchr(__FILE__,'/');
|
|
|
|
- file += sizeof(char);
|
|
|
|
- _STARPU_TRACE_RWLOCK_UNLOCKED(file,__LINE__);
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ _STARPU_TRACE_RWLOCK_UNLOCKED(file,__LINE__);
|
|
|
|
+
|
|
return p_ret;
|
|
return p_ret;
|
|
}
|
|
}
|
|
|
|
|