]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/os-unix.cpp
vm: replace assert with FACTOR_ASSERT
[factor.git] / vm / os-unix.cpp
index cc53edea251bbbcac573b276d5380b1b37bc03ec..90c524ee2f18aaba21a91865692214b4fe57c45c 100755 (executable)
@@ -493,7 +493,7 @@ void *stdin_loop(void *arg)
 
 void factor_vm::open_console()
 {
-       assert(!stdin_thread_initialized_p);
+       FACTOR_ASSERT(!stdin_thread_initialized_p);
        safe_pipe(&control_read,&control_write);
        safe_pipe(&size_read,&size_write);
        safe_pipe(&stdin_read,&stdin_write);
@@ -513,7 +513,7 @@ void factor_vm::close_console()
 
 void factor_vm::lock_console()
 {
-       assert(stdin_thread_initialized_p);
+       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
        try to lock the same mutex and wait until unlock_console() is called. */
@@ -523,7 +523,7 @@ void factor_vm::lock_console()
 
 void factor_vm::unlock_console()
 {
-       assert(stdin_thread_initialized_p);
+       FACTOR_ASSERT(stdin_thread_initialized_p);
        pthread_mutex_unlock(&stdin_mutex);
 }
 
@@ -544,7 +544,7 @@ void factor_vm::handle_ctrl_c()
        sigaction_safe(SIGINT,&fep_sigaction,NULL);
 }
 
-void factor_vm::abort()
+void abort()
 {
        sig_t ret;
        do
@@ -553,7 +553,7 @@ void factor_vm::abort()
        }
        while(ret == SIG_ERR && errno == EINTR);
        
-       close_console();
+       factor_vm::close_console();
        ::abort();
 }