git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3564
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
if ((errcode = pthread_create(&(res_thread->t), NULL, wrapper_start_routine, res_thread)))
if ((errcode = pthread_create(&(res_thread->t), NULL, wrapper_start_routine, res_thread)))
- THROW0(system_error,errcode, "pthread_create failed");
+ THROW1(system_error,errcode, "pthread_create failed: %s",strerror(errcode));
int errcode;
if ((errcode = pthread_join(thread->t,thread_return)))
int errcode;
if ((errcode = pthread_join(thread->t,thread_return)))
- THROW0(system_error,errcode, "pthread_join failed");
+ THROW1(system_error,errcode, "pthread_join failed: %s",
+ strerror(errcode));
int errcode;
if ((errcode = pthread_mutex_init(&(res->m),NULL)))
int errcode;
if ((errcode = pthread_mutex_init(&(res->m),NULL)))
- THROW0(system_error,errcode,"pthread_mutex_init() failed");
+ THROW1(system_error,errcode,"pthread_mutex_init() failed: %s",
+ strerror(errcode));
int errcode;
if ((errcode=pthread_mutex_lock(&(mutex->m))))
int errcode;
if ((errcode=pthread_mutex_lock(&(mutex->m))))
- THROW1(system_error,errcode,"pthread_mutex_lock(%p) failed",mutex);
+ THROW2(system_error,errcode,"pthread_mutex_lock(%p) failed: %s",
+ mutex, strerror(errcode));
}
void xbt_mutex_unlock(xbt_mutex_t mutex) {
int errcode;
if ((errcode=pthread_mutex_unlock(&(mutex->m))))
}
void xbt_mutex_unlock(xbt_mutex_t mutex) {
int errcode;
if ((errcode=pthread_mutex_unlock(&(mutex->m))))
- THROW1(system_error,errcode,"pthread_mutex_unlock(%p) failed",mutex);
+ THROW2(system_error,errcode,"pthread_mutex_unlock(%p) failed: %s",
+ mutex, strerror(errcode));
}
void xbt_mutex_destroy(xbt_mutex_t mutex) {
}
void xbt_mutex_destroy(xbt_mutex_t mutex) {
if (!mutex) return;
if ((errcode=pthread_mutex_destroy(&(mutex->m))))
if (!mutex) return;
if ((errcode=pthread_mutex_destroy(&(mutex->m))))
- THROW1(system_error,errcode,"pthread_mutex_destroy(%p) failed",mutex);
+ THROW2(system_error,errcode,"pthread_mutex_destroy(%p) failed: %s",
+ mutex, strerror(errcode));
xbt_thcond_t res = xbt_new(s_xbt_thcond_t,1);
int errcode;
if ((errcode=pthread_cond_init(&(res->c),NULL)))
xbt_thcond_t res = xbt_new(s_xbt_thcond_t,1);
int errcode;
if ((errcode=pthread_cond_init(&(res->c),NULL)))
- THROW0(system_error,errcode,"pthread_cond_init() failed");
+ THROW1(system_error,errcode,"pthread_cond_init() failed: %s",
+ strerror(errcode));
void xbt_thcond_wait(xbt_thcond_t cond, xbt_mutex_t mutex) {
int errcode;
if ((errcode=pthread_cond_wait(&(cond->c),&(mutex->m))))
void xbt_thcond_wait(xbt_thcond_t cond, xbt_mutex_t mutex) {
int errcode;
if ((errcode=pthread_cond_wait(&(cond->c),&(mutex->m))))
- THROW2(system_error,errcode,"pthread_cond_wait(%p,%p) failed",cond,mutex);
+ THROW3(system_error,errcode,"pthread_cond_wait(%p,%p) failed: %s",
+ cond,mutex, strerror(errcode));
}
void xbt_thcond_signal(xbt_thcond_t cond) {
int errcode;
if ((errcode=pthread_cond_signal(&(cond->c))))
}
void xbt_thcond_signal(xbt_thcond_t cond) {
int errcode;
if ((errcode=pthread_cond_signal(&(cond->c))))
- THROW1(system_error,errcode,"pthread_cond_signal(%p) failed",cond);
+ THROW2(system_error,errcode,"pthread_cond_signal(%p) failed: %s",
+ cond, strerror(errcode));
}
void xbt_thcond_broadcast(xbt_thcond_t cond){
int errcode;
if ((errcode=pthread_cond_broadcast(&(cond->c))))
}
void xbt_thcond_broadcast(xbt_thcond_t cond){
int errcode;
if ((errcode=pthread_cond_broadcast(&(cond->c))))
- THROW1(system_error,errcode,"pthread_cond_broadcast(%p) failed",cond);
+ THROW2(system_error,errcode,"pthread_cond_broadcast(%p) failed: %s",
+ cond, strerror(errcode));
}
void xbt_thcond_destroy(xbt_thcond_t cond){
int errcode;
}
void xbt_thcond_destroy(xbt_thcond_t cond){
int errcode;
if (!cond) return;
if ((errcode=pthread_cond_destroy(&(cond->c))))
if (!cond) return;
if ((errcode=pthread_cond_destroy(&(cond->c))))
- THROW1(system_error,errcode,"pthread_cond_destroy(%p) failed",cond);
+ THROW2(system_error,errcode,"pthread_cond_destroy(%p) failed: %s",
+ cond, strerror(errcode));