]> gitweb.factorcode.org Git - factor.git/commitdiff
os-unix: Actually call pthread_join() to avoid an infinite loop and 100% cpu usage...
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 26 Oct 2012 17:36:01 +0000 (10:36 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 26 Oct 2012 17:36:01 +0000 (10:36 -0700)
vm/os-unix.cpp

index 51b216f8448b085c65502223481e5b5129ac21df..fc996d1201925aca92bae86e21e60c98069fb077 100755 (executable)
@@ -505,8 +505,10 @@ 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)
+       if (stdin_thread_initialized_p) {
                pthread_cancel(stdin_thread);
+               pthread_join(stdin_thread, 0);
+       }
 }
 
 void factor_vm::lock_console()