summaryrefslogtreecommitdiff
path: root/libguile/__scm.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-05-06 00:17:35 +0200
committerAndy Wingo <wingo@pobox.com>2011-05-06 00:17:35 +0200
commita2a6c0e319b5c146c484cb1fe8ffc9b14b9a9876 (patch)
treedaec4c1b9cc5f45b0fe6d3330db1657143bff86a /libguile/__scm.h
parenta2230b653b86cece1daab09315873b5a4c592d6b (diff)
downloadguile-a2a6c0e319b5c146c484cb1fe8ffc9b14b9a9876.tar.gz
avoid tls gets when handling interrupts in the vm
* libguile/__scm.h (SCM_ASYNC_TICK_WITH_CODE): Redefine to take a scm_i_thread* as well. OK to do because it's within a BUILDING_LIBGUILE block. * libguile/vm-engine.c (vm_engine): Cache the scm_i_thread* instead of the dynstate, so we can use the thread for ticks. * libguile/vm-engine.h (VM_HANDLE_INTERRUPTS): Tick with the scm_i_thread* local var, to avoid excessive tls calls. * libguile/vm-i-system.c: Fix dynstate users to use current_thread->dynamic_state.
Diffstat (limited to 'libguile/__scm.h')
-rw-r--r--libguile/__scm.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/__scm.h b/libguile/__scm.h
index 2bfb4f694..f5551ad7a 100644
--- a/libguile/__scm.h
+++ b/libguile/__scm.h
@@ -536,10 +536,10 @@ SCM_API void scm_async_tick (void);
while (0)
/* SCM_ASYNC_TICK_WITH_CODE is only available to Guile itself */
-# define SCM_ASYNC_TICK_WITH_CODE(stmt) \
+# define SCM_ASYNC_TICK_WITH_CODE(thr, stmt) \
do \
{ \
- if (SCM_UNLIKELY (SCM_I_CURRENT_THREAD->pending_asyncs)) \
+ if (SCM_UNLIKELY (thr->pending_asyncs)) \
{ \
stmt; \
scm_async_click (); \