Index: /release/1.2/source/lisp-kernel/thread_manager.c
===================================================================
--- /release/1.2/source/lisp-kernel/thread_manager.c	(revision 9997)
+++ /release/1.2/source/lisp-kernel/thread_manager.c	(revision 9998)
@@ -61,4 +61,5 @@
 raise_thread_interrupt(TCR *target)
 {
+  pthread_t thread = (pthread_t)target->osid;
 #ifdef DARWIN_not_yet
   if (use_mach_exception_handling) {
@@ -66,5 +67,8 @@
   }
 #endif
- return pthread_kill((pthread_t)target->osid, SIGNAL_FOR_PROCESS_INTERRUPT);
+  if (thread != (pthread_t) 0) {
+    return pthread_kill(thread, SIGNAL_FOR_PROCESS_INTERRUPT);
+  }
+  return ESRCH;
 }
 #endif
@@ -180,5 +184,4 @@
 lock_recursive_lock(RECURSIVE_LOCK m, TCR *tcr)
 {
-  natural val;
   if (tcr == NULL) {
     tcr = get_tcr(true);
@@ -232,5 +235,5 @@
 unlock_recursive_lock(RECURSIVE_LOCK m, TCR *tcr)
 {
-  int ret = EPERM, pending;
+  int ret = EPERM;
 
    if (tcr == NULL) {
@@ -1108,5 +1111,4 @@
 {
   thread_activation activation;
-  TCR *current = get_tcr(false);
 
 
@@ -1279,4 +1281,5 @@
 {
   int suspend_count = atomic_incf(&(tcr->suspend_count));
+  pthread_t thread;
   if (suspend_count == 1) {
 #if SUSPEND_RESUME_VERBOSE
@@ -1289,5 +1292,7 @@
     }
 #endif
-    if (pthread_kill((pthread_t)(tcr->osid), thread_suspend_signal) == 0) {
+    thread = (pthread_t)(tcr->osid);
+    if ((thread != (pthread_t) 0) &&
+        (pthread_kill(thread, thread_suspend_signal) == 0)) {
       SET_TCR_FLAG(tcr,TCR_FLAG_BIT_SUSPEND_ACK_PENDING);
     } else {
@@ -1357,5 +1362,5 @@
 resume_tcr(TCR *tcr)
 {
-  int suspend_count = atomic_decf(&(tcr->suspend_count)), err;
+  int suspend_count = atomic_decf(&(tcr->suspend_count));
   if (suspend_count == 0) {
 #ifdef DARWIN
@@ -1574,5 +1579,5 @@
 
   void *p = calloc(1,sizeof(rwlock)+cache_block_size-1);
-  rwlock *rw;
+  rwlock *rw = NULL;;
   
   if (p) {
