1.0.15.27: nicer lambda-lists for GCD and LCM
[sbcl.git] / src / runtime / thread.c
index 5b8ec4a..6489d7d 100644 (file)
@@ -235,7 +235,6 @@ create_cleanup_thread(struct thread *thread_to_be_cleaned_up)
             (os_vm_address_t) thread_to_be_cleaned_up->os_address;
         result = pthread_create(&thread, NULL, cleanup_thread, freeable);
         gc_assert(result == 0);
-        sched_yield();
     }
 }
 
@@ -365,13 +364,9 @@ create_thread_struct(lispobj initial_function) {
     void *spaces=0;
     void *aligned_spaces=0;
 #ifdef LISP_FEATURE_SB_THREAD
-    int i;
+    unsigned int i;
 #endif
 
-#ifdef CREATE_CLEANUP_THREAD
-    /* Give a chance for cleanup threads to run. */
-    sched_yield();
-#endif
     /* May as well allocate all the spaces at once: it saves us from
      * having to decide what to do if only some of the allocations
      * succeed.  SPACES must be page-aligned, since the GC expects the
@@ -522,7 +517,7 @@ boolean create_os_thread(struct thread *th,os_thread_t *kid_tid)
     pthread_attr_t attr;
     sigset_t newset,oldset;
     boolean r=1;
-    int retcode, initcode, sizecode, addrcode;
+    int retcode = 0, initcode;
 
     FSHOW_SIGNAL((stderr,"/create_os_thread: creating new thread\n"));
 
@@ -551,7 +546,7 @@ boolean create_os_thread(struct thread *th,os_thread_t *kid_tid)
 #undef CONTROL_STACK_ADJUST
        (retcode = pthread_create
         (kid_tid,&attr,(void *(*)(void *))new_thread_trampoline,th))) {
-        FSHOW_SIGNAL((stderr, "init, size, addr = %d, %d, %d\n", initcode, sizecode, addrcode));
+        FSHOW_SIGNAL((stderr, "init = %d\n", initcode));
         FSHOW_SIGNAL((stderr, printf("pthread_create returned %d, errno %d\n", retcode, errno)));
         FSHOW_SIGNAL((stderr, "wanted stack size %d, min stack size %d\n",
                       THREAD_CONTROL_STACK_SIZE-16, PTHREAD_STACK_MIN));
@@ -734,3 +729,13 @@ void gc_start_the_world()
     FSHOW_SIGNAL((stderr,"/gc_start_the_world:end\n"));
 }
 #endif
+
+int
+thread_yield()
+{
+#ifdef LISP_FEATURE_SB_THREAD
+    return sched_yield();
+#else
+    return 0;
+#endif
+}