Little fixup around pthreads

Marc CHALAND marc.chaland at gmail.com
Thu Aug 18 11:48:05 CEST 2011


Hi guys,
Symptoms are: sem_timedwait behaves quite like sem_wait after
0x80000000 usec system has been started.
Regards
Marc

diff --git a/src/l4/pkg/uclibc/lib/libpthread/src/restart.h
b/src/l4/pkg/uclibc/lib/libpthread/src/restart
index 26ae5ea..92b71d3 100644
--- a/src/l4/pkg/uclibc/lib/libpthread/src/restart.h
+++ b/src/l4/pkg/uclibc/lib/libpthread/src/restart.h
@@ -37,7 +37,7 @@ static __inline__ int timedsuspend(pthread_descr self,
 {
 #if 1
   extern uint64_t __attribute__((weak)) __libc_l4_kclock_offset;
-  uint64_t clock = abstime->tv_sec * 1000000 + abstime->tv_nsec / 1000;
+  uint64_t clock = ((uint64_t) abstime->tv_sec) * 1000000 +
((uint64_t) abstime->tv_nsec) / 1000;
   if (&__libc_l4_kclock_offset)
     clock -= __libc_l4_kclock_offset;
   l4_msgtag_t res = l4_usem_down_to(self->p_thsem_cap, &self->p_thsem,




More information about the l4-hackers mailing list