[Openmcl-cvs-notifications] r15289 - in /trunk/source/lisp-kernel: linuxarm/Makefile linuxppc/Makefile linuxppc64/Makefile linuxx8632/Makefile linuxx8664/Makefile thread_manager.c
gb at clozure.com
gb at clozure.com
Thu Mar 29 03:11:02 CDT 2012
Author: gb
Date: Thu Mar 29 03:11:02 2012
New Revision: 15289
Log:
In sem_wait_forever(), don't try to do repeated 1-second timed waits.
(While trying to debug something presumably unrelated on FreeBSD 9.0,
I kept seeing the old implementation return 0 before the semaphore
was raised and got a bit nervous about the assumption that timevals
and timespecs were identical, etc.)
When doing a timed semaphore wait on a platform that uses POSIX
semaphores, use clock_gettime(CLOCK_REALTIME,...) instead of
gettimeofday() to get the current time and avoid any timval/timespec
issues.
This requires linking against librt on Linux; change the affected
Makefiles to do so.
Modified:
trunk/source/lisp-kernel/linuxarm/Makefile
trunk/source/lisp-kernel/linuxppc/Makefile
trunk/source/lisp-kernel/linuxppc64/Makefile
trunk/source/lisp-kernel/linuxx8632/Makefile
trunk/source/lisp-kernel/linuxx8664/Makefile
trunk/source/lisp-kernel/thread_manager.c
Modified: trunk/source/lisp-kernel/linuxarm/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/linuxarm/Makefile (original)
+++ trunk/source/lisp-kernel/linuxarm/Makefile Thu Mar 29 03:11:02 2012
@@ -82,7 +82,7 @@
# KSPOBJ=3D
# all: ../../ppccl ../../subprims.so
=
-OSLIBS =3D -ldl -lm -lpthread
+OSLIBS =3D -ldl -lm -lpthread -lrt
=
=
../../armcl: $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ)
Modified: trunk/source/lisp-kernel/linuxppc/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/linuxppc/Makefile (original)
+++ trunk/source/lisp-kernel/linuxppc/Makefile Thu Mar 29 03:11:02 2012
@@ -87,7 +87,7 @@
# KSPOBJ=3D
# all: ../../ppccl ../../subprims.so
=
-OSLIBS =3D -ldl -lm -lpthread
+OSLIBS =3D -ldl -lm -lpthread -lrt
=
=
../../ppccl: $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ)
Modified: trunk/source/lisp-kernel/linuxppc64/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/linuxppc64/Makefile (original)
+++ trunk/source/lisp-kernel/linuxppc64/Makefile Thu Mar 29 03:11:02 2012
@@ -75,7 +75,7 @@
# KSPOBJ=3D
# all: ../../ppccl64 ../../subprims.so
=
-OSLIBS =3D -ldl -lm -lpthread
+OSLIBS =3D -ldl -lm -lpthread -lrt
=
=
../../ppccl64: $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ)
Modified: trunk/source/lisp-kernel/linuxx8632/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/linuxx8632/Makefile (original)
+++ trunk/source/lisp-kernel/linuxx8632/Makefile Thu Mar 29 03:11:02 2012
@@ -69,7 +69,7 @@
all: ../../lx86cl
=
=
-OSLIBS =3D -ldl -lm -lpthread
+OSLIBS =3D -ldl -lm -lpthread -lrt
LINK_SCRIPT =3D # ./elf_x86_32.x
USE_LINK_SCRIPT =3D # -T $(LINK_SCRIPT)
=
Modified: trunk/source/lisp-kernel/linuxx8664/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/linuxx8664/Makefile (original)
+++ trunk/source/lisp-kernel/linuxx8664/Makefile Thu Mar 29 03:11:02 2012
@@ -69,7 +69,7 @@
all: ../../lx86cl64
=
=
-OSLIBS =3D -ldl -lm -lpthread
+OSLIBS =3D -ldl -lm -lpthread -lrt
LINK_MAP =3D ./elf_x86_64.x
USE_LINK_MAP =3D # -T ./elf_x86_64.x
=
Modified: trunk/source/lisp-kernel/thread_manager.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/thread_manager.c (original)
+++ trunk/source/lisp-kernel/thread_manager.c Thu Mar 29 03:11:02 2012
@@ -454,17 +454,13 @@
=
do {
#ifdef USE_MACH_SEMAPHORES
- mach_timespec_t q =3D {1,0};
- status =3D SEM_TIMEDWAIT(s,q);
+ status =3D SEM_WAIT(s);
#endif
#ifdef USE_POSIX_SEMAPHORES
- struct timespec q;
- gettimeofday((struct timeval *)&q, NULL);
- q.tv_sec +=3D 1;
- status =3D SEM_TIMEDWAIT(s,&q);
+ status =3D SEM_WAIT(s);
#endif
#ifdef USE_WINDOWS_SEMAPHORES
- status =3D (WaitForSingleObject(s,1000L) =3D=3D WAIT_TIMEOUT) ? 1 : 0;
+ status =3D (WaitForSingleObject(s,INFINITE) =3D=3D WAIT_OBJECT_0) ? 0 =
: 1;
#endif
} while (status !=3D 0);
}
@@ -477,8 +473,7 @@
int status;
=
struct timespec q;
- gettimeofday((struct timeval *)&q, NULL);
- q.tv_nsec *=3D 1000L; /* microseconds -> nanoseconds */
+ clock_gettime(CLOCK_REALTIME,&q);
=
q.tv_nsec +=3D nanos;
if (q.tv_nsec >=3D 1000000000L) {
More information about the Openmcl-cvs-notifications
mailing list