]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/vm.hpp
VM: implement a ctrl-break handler thread (#1573)
[factor.git] / vm / vm.hpp
index 5fc4aabf543b6b41319f44c444b6621e8244ae7c..900ca98dec419abc321348e492b38b37d34d5e7d 100644 (file)
--- a/vm/vm.hpp
+++ b/vm/vm.hpp
@@ -393,6 +393,7 @@ struct factor_vm {
   void factorbug_usage(bool advanced_p);
   void factorbug();
   void primitive_die();
+  volatile bool stop_on_ctrl_break;
 
   // arrays
   inline void set_array_nth(array* array, cell slot, cell value);
@@ -701,6 +702,11 @@ struct factor_vm {
 
 // os-windows
 #if defined(WINDOWS)
+  /* Id of the main thread we run in. Used for Ctrl-Break handling. */
+  DWORD thread_id;
+
+  HANDLE ctrl_break_thread;
+
   HANDLE sampler_thread;
   void sampler_thread_loop();