Locking with SCO cc.
authordrepper <drepper>
Tue, 9 Jun 1998 15:00:58 +0000 (15:00 +0000)
committerdrepper <drepper>
Tue, 9 Jun 1998 15:00:58 +0000 (15:00 +0000)
db2/mutex/sco.cc [new file with mode: 0644]

diff --git a/db2/mutex/sco.cc b/db2/mutex/sco.cc
new file mode 100644 (file)
index 0000000..7c165a2
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * @(#)x86.uslc
+ *
+ * UnixWare has threads in libthread, but OpenServer doesn't (yet).
+ *
+ * For cc/x86, 0 is clear, 1 is set.
+ */
+
+#if defined(__USLC__)
+asm int
+_tsl_set(void *tsl)
+{
+%mem tsl
+       movl    tsl, %ecx
+       movl    $1, %eax
+       lock
+       xchgb   (%ecx),%al
+       xorl    $1,%eax
+}
+#endif
+
+#define        TSL_SET(tsl)    _tsl_set(tsl)
+#define        TSL_UNSET(tsl)  (*(tsl) = 0)
+#define        TSL_INIT(tsl)   TSL_UNSET(tsl)