aboutsummaryrefslogtreecommitdiffstats
path: root/src/thread.h
diff options
context:
space:
mode:
authorTom Tromey2012-08-15 13:04:34 -0600
committerTom Tromey2012-08-15 13:04:34 -0600
commite160922c665ba65e1dba5b87a924927e61be43b9 (patch)
treede8f62c4788a9d641280cabc94767114f462aef4 /src/thread.h
parent14b3dc5e4f2cdefde1ba04ddd3525115e7ca7dce (diff)
downloademacs-e160922c665ba65e1dba5b87a924927e61be43b9.tar.gz
emacs-e160922c665ba65e1dba5b87a924927e61be43b9.zip
This introduces some new functions to handle the specpdl. The basic
idea is that when a thread loses the interpreter lock, it will unbind the bindings it has put in place. Then when a thread acquires the lock, it will restore its bindings. This code reuses an existing empty slot in struct specbinding to store the current value when the thread is "swapped out". This approach performs worse than my previously planned approach. However, it was one I could implement with minimal time and brainpower. I hope that perhaps someone else could improve the code once it is in.
Diffstat (limited to 'src/thread.h')
-rw-r--r--src/thread.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/thread.h b/src/thread.h
index 020346b9af2..def05fdaec9 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -83,6 +83,12 @@ struct thread_state
83 struct specbinding *m_specpdl_ptr; 83 struct specbinding *m_specpdl_ptr;
84#define specpdl_ptr (current_thread->m_specpdl_ptr) 84#define specpdl_ptr (current_thread->m_specpdl_ptr)
85 85
86 /* Pointer to the first "saved" element in specpdl. When this
87 thread is swapped out, the current values of all specpdl bindings
88 are pushed onto the specpdl; then these are popped again when
89 switching back to this thread. */
90 struct specbinding *m_saved_specpdl_ptr;
91
86 /* Depth in Lisp evaluations and function calls. */ 92 /* Depth in Lisp evaluations and function calls. */
87 EMACS_INT m_lisp_eval_depth; 93 EMACS_INT m_lisp_eval_depth;
88#define lisp_eval_depth (current_thread->m_lisp_eval_depth) 94#define lisp_eval_depth (current_thread->m_lisp_eval_depth)