diff options
Diffstat (limited to 'src/thread.h')
-rw-r--r-- | src/thread.h | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/src/thread.h b/src/thread.h index 8877f22ffa5..288b671257d 100644 --- a/src/thread.h +++ b/src/thread.h @@ -19,7 +19,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ #ifndef THREAD_H #define THREAD_H -#include "regex.h" +#include "regex-emacs.h" #ifdef WINDOWSNT #include <sys/socket.h> @@ -30,7 +30,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ #endif #include "sysselect.h" /* FIXME */ -#include "systime.h" /* FIXME */ #include "systhread.h" struct thread_state @@ -52,6 +51,9 @@ struct thread_state /* The thread's function. */ Lisp_Object function; + /* The thread's result, if function has finished. */ + Lisp_Object result; + /* If non-nil, this thread has been signaled. */ Lisp_Object error_symbol; Lisp_Object error_data; @@ -109,8 +111,8 @@ struct thread_state struct buffer *m_current_buffer; #define current_buffer (current_thread->m_current_buffer) - /* Every call to re_match, etc., must pass &search_regs as the regs - argument unless you can show it is unnecessary (i.e., if re_match + /* Every call to re_match_2, etc., must pass &search_regs as the regs + argument unless you can show it is unnecessary (i.e., if re_match_2 is certainly going to be called again before region-around-match can be called). @@ -137,15 +139,6 @@ struct thread_state struct re_registers m_saved_search_regs; #define saved_search_regs (current_thread->m_saved_search_regs) - /* This is the string or buffer in which we - are matching. It is used for looking up syntax properties. - - If the value is a Lisp string object, we are matching text in that - string; if it's nil, we are matching text in the current buffer; if - it's t, we are matching text in a C string. */ - Lisp_Object m_re_match_object; -#define re_match_object (current_thread->m_re_match_object) - /* This member is different from waiting_for_input. It is used to communicate to a lisp process-filter/sentinel (via the function Fwaiting_for_user_input_p) whether Emacs was waiting @@ -190,7 +183,7 @@ struct thread_state /* Threads are kept on a linked list. */ struct thread_state *next_thread; -}; +} GCALIGNED_STRUCT; INLINE bool THREADP (Lisp_Object a) @@ -208,7 +201,7 @@ INLINE struct thread_state * XTHREAD (Lisp_Object a) { eassert (THREADP (a)); - return XUNTAG (a, Lisp_Vectorlike); + return XUNTAG (a, Lisp_Vectorlike, struct thread_state); } /* A mutex in lisp is represented by a system condition variable. @@ -237,7 +230,7 @@ struct Lisp_Mutex /* The lower-level mutex object. */ lisp_mutex_t mutex; -}; +} GCALIGNED_STRUCT; INLINE bool MUTEXP (Lisp_Object a) @@ -255,7 +248,7 @@ INLINE struct Lisp_Mutex * XMUTEX (Lisp_Object a) { eassert (MUTEXP (a)); - return XUNTAG (a, Lisp_Vectorlike); + return XUNTAG (a, Lisp_Vectorlike, struct Lisp_Mutex); } /* A condition variable as a lisp object. */ @@ -271,7 +264,7 @@ struct Lisp_CondVar /* The lower-level condition variable object. */ sys_cond_t cond; -}; +} GCALIGNED_STRUCT; INLINE bool CONDVARP (Lisp_Object a) @@ -289,7 +282,7 @@ INLINE struct Lisp_CondVar * XCONDVAR (Lisp_Object a) { eassert (CONDVARP (a)); - return XUNTAG (a, Lisp_Vectorlike); + return XUNTAG (a, Lisp_Vectorlike, struct Lisp_CondVar); } extern struct thread_state *current_thread; @@ -303,6 +296,7 @@ extern void init_threads_once (void); extern void init_threads (void); extern void syms_of_threads (void); extern bool main_thread_p (void *); +extern bool in_current_thread (void); typedef int select_func (int, fd_set *, fd_set *, fd_set *, const struct timespec *, const sigset_t *); |