sigdelset(&mask, SIGQUIT);
pthread_sigmask(SIG_SETMASK, &mask, NULL);
- int dontcare;
- pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &dontcare);
- pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &dontcare);
+ int unused;
+ pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &unused);
+ pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &unused);
while(loop_running)
{
for(;;)
{
- // If we fep, the parent thread will grab stdin_mutex and send us
- // SIGUSR2 to interrupt the read() call.
+ /* If we fep, the parent thread will grab stdin_mutex and send us
+ SIGUSR2 to interrupt the read() call. */
pthread_mutex_lock(&stdin_mutex);
pthread_mutex_unlock(&stdin_mutex);
ssize_t bytes = read(0,buf,sizeof(buf));
pthread_mutex_init(&stdin_mutex, NULL);
}
-// 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
+/* 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()
{
if (stdin_thread_initialized_p)
void factor_vm::lock_console()
{
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
- // try to lock the same mutex and wait until unlock_console() is called.
+ /* 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
+ try to lock the same mutex and wait until unlock_console() is called. */
pthread_mutex_lock(&stdin_mutex);
pthread_kill(stdin_thread, SIGUSR2);
}