static sys_jmp_buf getcjmp;
-/* True while doing kbd input. */
-bool waiting_for_input;
-
/* True while displaying for echoing. Delays C-g throwing. */
static bool echoing;
/* Incremented whenever a timer is run. */
unsigned timers_run;
-/* Address (if not 0) of struct timespec to zero out if a SIGIO interrupt
- happens. */
-struct timespec *input_available_clear_time;
-
/* True means use SIGIO interrupts; false means use CBREAK mode.
Default is true if INTERRUPT_INPUT is defined. */
bool interrupt_input;
#define EVENT_HEAD_KIND(event_head) \
(Fget ((event_head), Qevent_kind))
-/* True while doing kbd input. */
-extern bool waiting_for_input;
-
-/* Address (if not 0) of struct timespec to zero out if a SIGIO interrupt
- happens. */
-extern struct timespec *input_available_clear_time;
-
extern bool ignore_mouse_drag_p;
extern Lisp_Object parse_modifiers (Lisp_Object);
int m_waiting_for_user_input_p;
#define waiting_for_user_input_p (current_thread->m_waiting_for_user_input_p)
+ /* True while doing kbd input. */
+ bool m_waiting_for_input;
+#define waiting_for_input (current_thread->m_waiting_for_input)
+
+ /* Address (if not 0) of struct timespec to zero out if a SIGIO interrupt
+ happens. */
+ struct timespec *m_input_available_clear_time;
+#define input_available_clear_time (current_thread->m_input_available_clear_time)
+
/* The OS identifier for this thread. */
sys_thread_t thread_id;
#include "w32common.h" /* os_subtype */
#include "w32term.h" /* for all of the w32 includes */
#include "w32select.h"
-#include "keyboard.h" /* for waiting_for_input */
#include "blockinput.h"
#include "coding.h"
(string= "hi bob"
(condition-name (make-condition-variable (make-mutex)
"hi bob")))))
+(defun call-error ()
+ "Call `error'."
+ (error "Error is called"))
+
+;; This signals an error internally; the error should be caught.
+(defun thread-custom ()
+ (defcustom thread-custom-face 'highlight
+ "Face used for thread customizations."
+ :type 'face
+ :group 'widget-faces))
+
+(ert-deftest thread-errors ()
+ "Test what happens when a thread signals an error."
+ (should (threadp (make-thread #'call-error "call-error")))
+ (should (threadp (make-thread #'thread-custom "thread-custom"))))
;;; threads.el ends here