1.0.9.62: Performance and stability improvement of threading on FreeBSD
[sbcl.git] / src / runtime / thread.c
index a838c7d..5b8ec4a 100644 (file)
@@ -91,6 +91,9 @@ pthread_mutex_t all_threads_lock = PTHREAD_MUTEX_INITIALIZER;
 #ifdef LOCK_CREATE_THREAD
 static pthread_mutex_t create_thread_lock = PTHREAD_MUTEX_INITIALIZER;
 #endif
+#ifdef LISP_FEATURE_GCC_TLS
+__thread struct thread *current_thread;
+#endif
 #endif
 
 #if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
@@ -383,7 +386,7 @@ create_thread_struct(lispobj initial_function) {
      * padding. */
     aligned_spaces = (void *)((((unsigned long)(char *)spaces)
                                + BACKEND_PAGE_SIZE - 1)
-                              & ~(BACKEND_PAGE_SIZE - 1));
+                              & ~(unsigned long)(BACKEND_PAGE_SIZE - 1));
     per_thread=(union per_thread_data *)
         (aligned_spaces+
          THREAD_CONTROL_STACK_SIZE+