summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2010-03-04 04:46:13 +0200
committerM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2010-03-04 04:46:13 +0200
commit9ef5cfce720e903442cbf2818192330bb4b71fe4 (patch)
tree1f9711dce9d5899c7ae1ab470807cf29fe93f2a7
parent45a8a4b0f52dd3311cd095aa1b17b2fcd380d833 (diff)
Add minimal spin lock support.extra-stubs
-rw-r--r--list.txt8
-rw-r--r--stubs.c36
2 files changed, 40 insertions, 4 deletions
diff --git a/list.txt b/list.txt
index 9e48297..05527dc 100644
--- a/list.txt
+++ b/list.txt
@@ -93,9 +93,9 @@ alias("zero", [[pthread_setschedparam]])
alias("zero", [[pthread_setschedprio]])
alias("na", [[pthread_setspecific]])
alias("na", [[pthread_sigmask]])
-alias("na", [[pthread_spin_destroy]])
-alias("na", [[pthread_spin_init]])
-alias("na", [[pthread_spin_lock]])
+alias("zero", [[pthread_spin_destroy]])
+alias("zero", [[pthread_spin_init]])
+alias("zero", [[pthread_spin_lock]])
alias("na", [[pthread_spin_trylock]])
-alias("na", [[pthread_spin_unlock]])
+alias("zero", [[pthread_spin_unlock]])
alias("na", [[pthread_testcancel]])
diff --git a/stubs.c b/stubs.c
index b7d2e88..75f00e8 100644
--- a/stubs.c
+++ b/stubs.c
@@ -444,6 +444,42 @@ int pthread_setschedprio() __attribute__ ((weak, alias ("__pthread_zero_stub")))
# endif
#endif
+#ifndef HAVE_PTHREAD_SPIN_DESTROY
+#define NEED_ZERO_STUB
+# ifdef SUPPORT_ATTRIBUTE_ALIAS
+int pthread_spin_destroy() __attribute__ ((weak, alias ("__pthread_zero_stub")));
+# else
+# pragma weak pthread_spin_destroy = __pthread_zero_stub
+# endif
+#endif
+
+#ifndef HAVE_PTHREAD_SPIN_INIT
+#define NEED_ZERO_STUB
+# ifdef SUPPORT_ATTRIBUTE_ALIAS
+int pthread_spin_init() __attribute__ ((weak, alias ("__pthread_zero_stub")));
+# else
+# pragma weak pthread_spin_init = __pthread_zero_stub
+# endif
+#endif
+
+#ifndef HAVE_PTHREAD_SPIN_LOCK
+#define NEED_ZERO_STUB
+# ifdef SUPPORT_ATTRIBUTE_ALIAS
+int pthread_spin_lock() __attribute__ ((weak, alias ("__pthread_zero_stub")));
+# else
+# pragma weak pthread_spin_lock = __pthread_zero_stub
+# endif
+#endif
+
+#ifndef HAVE_PTHREAD_SPIN_UNLOCK
+#define NEED_ZERO_STUB
+# ifdef SUPPORT_ATTRIBUTE_ALIAS
+int pthread_spin_unlock() __attribute__ ((weak, alias ("__pthread_zero_stub")));
+# else
+# pragma weak pthread_spin_unlock = __pthread_zero_stub
+# endif
+#endif
+
#ifdef NEED_ZERO_STUB
static int __pthread_zero_stub()
{