return NULL;
}
-void factor_vm::open_console() {
+void open_console() {
FACTOR_ASSERT(!stdin_thread_initialized_p);
safe_pipe(&control_read, &control_write);
safe_pipe(&size_read, &size_write);
/* This method is used to kill the stdin_loop before exiting from factor.
A Nvidia driver bug on Linux is the reason this has to be done, see:
http://www.nvnews.net/vbulletin/showthread.php?t=164619 */
-void factor_vm::close_console() {
+void close_console() {
if (stdin_thread_initialized_p) {
pthread_cancel(stdin_thread);
pthread_join(stdin_thread, 0);
}
}
-void factor_vm::lock_console() {
+void lock_console() {
FACTOR_ASSERT(stdin_thread_initialized_p);
/* Lock the stdin_mutex and send the stdin_loop thread a signal to interrupt
any read() it has in progress. When the stdin loop iterates again, it will
pthread_kill(stdin_thread, SIGUSR2);
}
-void factor_vm::unlock_console() {
+void unlock_console() {
FACTOR_ASSERT(stdin_thread_initialized_p);
pthread_mutex_unlock(&stdin_mutex);
}
-void factor_vm::ignore_ctrl_c() {
+void ignore_ctrl_c() {
sig_t ret;
do {
ret = signal(SIGINT, SIG_DFL);
} while (ret == SIG_ERR && errno == EINTR);
}
-void factor_vm::handle_ctrl_c() {
+void handle_ctrl_c() {
struct sigaction fep_sigaction;
init_sigaction_with_handler(&fep_sigaction, fep_signal_handler);
sigaction_safe(SIGINT, &fep_sigaction, NULL);
ret = signal(SIGABRT, SIG_DFL);
} while (ret == SIG_ERR && errno == EINTR);
- factor_vm::close_console();
+ close_console();
::abort();
}
}
}
-void factor_vm::open_console() { handle_ctrl_c(); }
+void open_console() { handle_ctrl_c(); }
-void factor_vm::ignore_ctrl_c() {
+void ignore_ctrl_c() {
SetConsoleCtrlHandler(factor::ctrl_handler, FALSE);
}
-void factor_vm::handle_ctrl_c() {
+void handle_ctrl_c() {
SetConsoleCtrlHandler(factor::ctrl_handler, TRUE);
}
-void factor_vm::lock_console() {}
+void lock_console() {}
-void factor_vm::unlock_console() {}
+void unlock_console() {}
-void factor_vm::close_console() {}
+void close_console() {}
void factor_vm::sampler_thread_loop() {
LARGE_INTEGER counter, new_counter, units_per_second;
void init_signals();
void start_sampling_profiler_timer();
void end_sampling_profiler_timer();
- static void open_console();
- static void close_console();
- static void lock_console();
- static void unlock_console();
- static void ignore_ctrl_c();
- static void handle_ctrl_c();
// os-windows
#if defined(WINDOWS)