]> gitweb.factorcode.org Git - factor.git/commitdiff
vm: fashion police
authorJoe Groff <arcata@gmail.com>
Sun, 13 Nov 2011 06:39:28 +0000 (22:39 -0800)
committerJoe Groff <arcata@gmail.com>
Sun, 13 Nov 2011 07:05:44 +0000 (23:05 -0800)
vm/os-unix.cpp

index bb6def10b87815e839bac37c35932e6d9f151efd..079fcb4db01e344d7cc897034372adc6d140b420 100755 (executable)
@@ -446,9 +446,9 @@ void *stdin_loop(void *arg)
        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)
        {
@@ -460,8 +460,8 @@ void *stdin_loop(void *arg)
 
                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));
@@ -503,9 +503,9 @@ void factor_vm::open_console()
        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)
@@ -515,9 +515,9 @@ void factor_vm::close_console()
 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);
 }