threads back on - try this.

SVN revision: 27162
This commit is contained in:
Carsten Haitzler 2006-11-18 02:51:27 +00:00
parent df0c6f847c
commit f3e4e0d7ed
2 changed files with 12 additions and 6 deletions

View File

@ -995,7 +995,12 @@ AC_CHECK_HEADER(pthread.h,
AC_CHECK_HEADER(sched.h,
[
AC_CHECK_LIB(pthread, pthread_attr_setaffinity_np,
[ build_pthreads="yes" ],
[
AC_CHECK_LIB(pthread, pthread_barrier_wait,
[ build_pthreads="yes" ],
[ build_pthreads="no" ]
)
],
[ build_pthreads="no" ]
)
],
@ -1006,7 +1011,7 @@ AC_CHECK_HEADER(pthread.h,
)
### disable pthreads by default for now - some wierd deadlock issue with
# barriers (makes no sense)
build_pthreads="no"
#build_pthreads="no"
AC_MSG_CHECKING(whether to build pthread code)
AC_ARG_ENABLE(pthreads,
[ --enable-pthreads enable threaded rendering], [

View File

@ -132,6 +132,7 @@ evas_common_pipe_begin(RGBA_Image *im)
thread_num = cpunum;
if (thread_num == 1) return;
pthread_barrier_init(&(thbarrier[0]), NULL, thread_num + 1);
pthread_barrier_init(&(thbarrier[1]), NULL, thread_num + 1);
for (i = 0; i < thread_num; i++)
{
pthread_attr_t attr;
@ -179,9 +180,9 @@ evas_common_pipe_begin(RGBA_Image *im)
// printf("START %i\n", i);
}
/* tell worker threads to start */
pthread_barrier_init(&(thbarrier[1]), NULL, thread_num + 1);
// pthread_barrier_init(&(thbarrier[1]), NULL, thread_num + 1);
pthread_barrier_wait(&(thbarrier[0]));
pthread_barrier_destroy(&(thbarrier[0]));
// pthread_barrier_destroy(&(thbarrier[0]));
#endif
}
@ -197,9 +198,9 @@ evas_common_pipe_flush(RGBA_Image *im)
if (thread_num > 1)
{
/* sync worker threads */
pthread_barrier_init(&(thbarrier[0]), NULL, thread_num + 1);
// pthread_barrier_init(&(thbarrier[0]), NULL, thread_num + 1);
pthread_barrier_wait(&(thbarrier[1]));
pthread_barrier_destroy(&(thbarrier[1]));
// pthread_barrier_destroy(&(thbarrier[1]));
// printf("DONE\n");
}
else