Update of /cvsroot/sbcl/sbcl/src/runtime
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19033/src/runtime
Modified Files:
Tag: lutex-branch
linux-os.h linux-os.c
Log Message:
0.9.10.46.lutex-branch.15
* cleaning up lutex branch build for x86-64/linux
* #ifdef clean up to look for semaphore.h when not building mach
or carbon threads
* make some printfs be FSHOWs
* only define os_sem_t when building with threads on linux
* include lutex.h instead of futex.h when building with threads on
linux
Index: linux-os.h
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/linux-os.h,v
retrieving revision 1.13.6.1
retrieving revision 1.13.6.2
diff -u -d -r1.13.6.1 -r1.13.6.2
--- linux-os.h 21 Mar 2006 19:28:14 -0000 1.13.6.1
+++ linux-os.h 28 Mar 2006 18:33:34 -0000 1.13.6.2
@@ -22,16 +22,23 @@
#include <sys/syscall.h>
#include <asm/unistd.h>
#include <linux/version.h>
+
+#ifdef LISP_FEATURE_SB_THREAD
+#include <semaphore.h>
+#endif
+
#include "target-arch-os.h"
#include "target-arch.h"
-
#define linuxversion(a, b, c) (((a)<<16)+((b)<<8)+(c))
typedef caddr_t os_vm_address_t;
typedef size_t os_vm_size_t;
typedef off_t os_vm_offset_t;
typedef int os_vm_prot_t;
+
+#ifdef LISP_FEATURE_SB_THREAD
typedef sem_t os_sem_t;
+#endif
#define OS_VM_PROT_READ PROT_READ
#define OS_VM_PROT_WRITE PROT_WRITE
Index: linux-os.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/linux-os.c,v
retrieving revision 1.60.2.1
retrieving revision 1.60.2.2
diff -u -d -r1.60.2.1 -r1.60.2.2
--- linux-os.c 21 Mar 2006 19:28:14 -0000 1.60.2.1
+++ linux-os.c 28 Mar 2006 18:33:34 -0000 1.60.2.2
@@ -34,9 +34,15 @@
#include "runtime.h"
#include "genesis/static-symbols.h"
#include "genesis/fdefn.h"
+
#ifdef LISP_FEATURE_SB_THREAD
+#ifdef LISP_FEATURE_SB_LUTEX
+#include "genesis/lutex.h"
+#else
#include "genesis/futex.h"
#endif
+#endif
+
#include <sys/socket.h>
#include <sys/utsname.h>
@@ -68,26 +74,26 @@
int futex_init(os_sem_t *semaphore)
{
- printf("Initializing semaphore @ %p\n", semaphore);
-
- return sem_init(semaphore, 0, 1);
+ FSHOW_SIGNAL((stderr, "/initializing semaphore @ %p\n", semaphore));
+ return sem_init(semaphore, 0, 1);
}
int futex_wait(os_sem_t *semaphore)
{
- printf("Waiting on semaphore %p\n", semaphore);
- return sem_wait(semaphore);
+ FSHOW_SIGNAL((stderr, "/waiting on semaphore @ %p\n", semaphore));
+ return sem_wait(semaphore);
}
int futex_wake(os_sem_t *semaphore)
{
- printf("Waking on semaphore %p\n", semaphore);
- return sem_post(semaphore);
+ FSHOW_SIGNAL((stderr, "/waking semaphore @ %p, *semaphore=%p\n", semaphore, (void*)*semaphore));
+ return sem_post(semaphore);
}
int futex_destroy(os_sem_t *semaphore)
{
- return sem_destroy(semaphore);
+ FSHOW_SIGNAL((stderr, "/destroying semaphore @ %p\n", semaphore));
+ return sem_destroy(semaphore);
}
#else
@@ -149,7 +155,7 @@
{
/* Conduct various version checks: do we have enough mmap(), is
* this a sparc running 2.2, can we do threads? */
-#ifdef LISP_FEATURE_SB_THREAD
+#if defined(LISP_FEATURE_SB_THREAD) && !defined(LISP_FEATURE_SB_LUTEX)
int *futex=0;
#endif
struct utsname name;
|