1
1

disable thread calls if pthreads not available

This commit was SVN r1445.
Этот коммит содержится в:
Tim Woodall 2004-06-23 14:16:02 +00:00
родитель 3d7e403cc1
Коммит 8f98c8a986

Просмотреть файл

@ -30,6 +30,7 @@ typedef void* (*pthread_start_fn_t)(void*);
int ompi_thread_start(ompi_thread_t* t) int ompi_thread_start(ompi_thread_t* t)
{ {
#if OMPI_HAVE_POSIX_THREADS
int rc; int rc;
#if OMPI_ENABLE_DEBUG #if OMPI_ENABLE_DEBUG
if(NULL == t->t_run || t->t_handle != -1) if(NULL == t->t_run || t->t_handle != -1)
@ -37,11 +38,18 @@ int ompi_thread_start(ompi_thread_t* t)
#endif #endif
rc = pthread_create(&t->t_handle, NULL, (pthread_start_fn_t)t->t_run, t); rc = pthread_create(&t->t_handle, NULL, (pthread_start_fn_t)t->t_run, t);
return (rc == 0) ? OMPI_SUCCESS: OMPI_ERROR; return (rc == 0) ? OMPI_SUCCESS: OMPI_ERROR;
#else
return OMPI_ERROR;
#endif
} }
int ompi_thread_join(ompi_thread_t* t, void** thr_return) int ompi_thread_join(ompi_thread_t* t, void** thr_return)
{ {
#if OMPI_HAVE_POSIX_THREADS
int rc = pthread_join(t->t_handle, thr_return); int rc = pthread_join(t->t_handle, thr_return);
return (rc == 0) ? OMPI_SUCCESS: OMPI_ERROR; return (rc == 0) ? OMPI_SUCCESS: OMPI_ERROR;
#else
return OMPI_ERROR;
#endif
} }