[Openmcl-cvs-notifications] r11184 - in /trunk/source/lisp-kernel: Threads.h thread_manager.c
gb at clozure.com
gb at clozure.com
Tue Oct 21 00:55:00 EDT 2008
Author: gb
Date: Tue Oct 21 00:55:00 2008
New Revision: 11184
Log:
#include <sys/syscall.h> on Linux. use gettid() (which is only
available via syscall) for get_current_native_thread_id() on Linux.
(These thread IDs are what're used by GDB's 'info threads' command;
they're pid's from the linux kernel's perspective, but threads within
a process all see the same value returned by getpid() in modern Linux.)
Fall back to getpid() if the syscall isn't defined, but I'm not sure
that we can run on something so old that the syscall wouldn't be defined.
Modified:
trunk/source/lisp-kernel/Threads.h
trunk/source/lisp-kernel/thread_manager.c
Modified: trunk/source/lisp-kernel/Threads.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=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/Threads.h (original)
+++ trunk/source/lisp-kernel/Threads.h Tue Oct 21 00:55:00 2008
@@ -33,6 +33,10 @@
#ifdef SOLARIS
#include <sys/syscall.h>
#include <sys/lwp.h>
+#endif
+
+#ifdef LINUX
+#include <sys/syscall.h>
#endif
=
#undef USE_MACH_SEMAPHORES
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 Tue Oct 21 00:55:00 2008
@@ -1323,7 +1323,11 @@
{
return ((void *) (natural)
#ifdef LINUX
+#ifdef __NR_gettid
+ syscall(__NR_gettid)
+#else
getpid()
+#endif
#endif
#ifdef DARWIN
mach_thread_self()
More information about the Openmcl-cvs-notifications
mailing list