[uClibc]wrong pthread_cond_timedwait-function used

Christian Krause chkr at peppercon.com
Thu Jan 30 14:10:53 UTC 2003


Hi,

I found a problem in uClibc in libpthread/linuxthres/condvar.c:

pthread_cond_timedwait never uses rt singals

uClibc has two implementations of pthread_cond_timewait -
pthread_cond_timedwait_relative_old using the "normal" signals and
pthread_cond_timedwait_relative_new usign the rt signals
(for kernels >= 2.2).

The function pointer pthread_cond_tw_rel is initialised with the old
function. In "__pthread_init_condvar(int)" this pointer is set to the new
function using rt signals, but "__pthread_init_condvar" is never called in
the uClibc.

The following patch solves this issue, so that __pthread_init_condvars
is called and the function pointer is always initialised with the correct
function.

regards,
christian

--------------------
--- pthread.c   26 Aug 2002 13:07:26 -0000      1.1.9.2
+++ pthread.c   30 Jan 2003 13:55:02 -0000
@@ -334,6 +334,9 @@
   /* Do it early so that user-registered atexit functions are called
      before pthread_exit_process. */
   on_exit(pthread_exit_process, NULL);
+#ifdef __NR_rt_sigaction
+   __pthread_init_condvar(1);
+#endif
 }

 void __pthread_initialize(void)
-----------------------




More information about the uClibc mailing list