[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

IA-64 use synchronization primitives



On IA-64, the dl-fptr.c file in libc includes pt-machine.h, which is
part of the linuxthreads distribution.

As far as I can tell, the only reason it includes this is for it's
testandset operation, for which we have synchronisation primitives.
This dependency is also in the hppa tree, but I'm not sure how to
solve that one.

-i
ianw gelato unsw edu au
http://www.gelato.unsw.edu.au

--- sysdeps/ia64/dl-fptr.c.old  2002-11-12 11:32:49.000000000 +1100
+++ sysdeps/ia64/dl-fptr.c      2002-11-12 11:46:47.000000000 +1100
@@ -27,7 +27,7 @@
 #include <elf/dynamic-link.h>
 #include <dl-machine.h>
 #ifdef _LIBC_REENTRANT
-# include <pt-machine.h>
+#include <ia64intrin.h>
 # include <signal.h>
 # include <time.h>
 #endif
@@ -73,7 +73,7 @@
   if (!__sigismember (&(l)->full_sigset, SIGINT))              \
     __sigfillset (&(l)->full_sigset);                          \
                                                                \
-  while (testandset ((int *) &(l)->lock))                      \
+  while (__sync_lock_test_and_set ( &(l)->lock, 1))            \
     {                                                          \
       struct timespec ts;                                      \
       if (i > 0)                                               \
@@ -88,7 +88,7 @@
   __sigprocmask (SIG_BLOCK, &(l)->full_sigset, &_saved_set);
 # define unlock(l)                                             \
   __sigprocmask (SIG_SETMASK, &_saved_set, NULL);              \
-  (l)->lock = 0;                                               \
+  __sync_lock_release( &(l)->lock );                           \
 }
 #else
 # define lock(l)





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]