From 99987c76d53d57d4965dbd4ded7da5a7835da282 Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Sun, 21 Feb 2016 14:05:55 +0300 Subject: [PATCH] Fix single-threaded builds. thread->interrupt_data has to be allocated on single-threaded builds. --- src/runtime/thread.c | 7 ++++--- src/runtime/thread.h | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/runtime/thread.c b/src/runtime/thread.c index a1e741272..50f931d42 100644 --- a/src/runtime/thread.c +++ b/src/runtime/thread.c @@ -708,12 +708,13 @@ create_thread_struct(lispobj initial_function) { th->csp_around_foreign_call = csp_page; #endif -#ifdef LISP_FEATURE_SB_THREAD - struct nonpointer_thread_data *nonpointer_data = (void *) &per_thread->dynamic_values[TLS_SIZE]; - th->os_attr = &nonpointer_data->os_attr; + th->interrupt_data = &nonpointer_data->interrupt_data; + +#ifdef LISP_FEATURE_SB_THREAD + th->os_attr = &nonpointer_data->os_attr; # ifndef LISP_FEATURE_SB_SAFEPOINT th->state_sem = &nonpointer_data->state_sem; th->state_not_running_sem = &nonpointer_data->state_not_running_sem; diff --git a/src/runtime/thread.h b/src/runtime/thread.h index 00f2927b8..2e3353a42 100644 --- a/src/runtime/thread.h +++ b/src/runtime/thread.h @@ -100,12 +100,14 @@ union per_thread_data { * pointers can be later shoved into the thread struct. */ struct nonpointer_thread_data { -#if defined(LISP_FEATURE_SB_THREAD) && !defined(LISP_FEATURE_SB_SAFEPOINT) +#ifdef LISP_FEATURE_SB_THREAD + pthread_attr_t os_attr; +#ifndef LISP_FEATURE_SB_SAFEPOINT os_sem_t state_sem; os_sem_t state_not_running_sem; os_sem_t state_not_stopped_sem; #endif - pthread_attr_t os_attr; +#endif struct interrupt_data interrupt_data; }; -- 2.11.4.GIT