Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow for exiting from a different thread

  • Loading branch information...
commit 8dc44f082bb45ab2f62148c7f9d90ee960184b98 1 parent 4318726
@dbussink dbussink authored
View
2  vm/builtin/thread.cpp
@@ -132,7 +132,7 @@ namespace rubinius {
if(!ret) {
if(vm->thread_state()->raise_reason() == cExit) {
- vm->shared.env()->halt();
+ vm->shared.env()->halt_and_exit(state);
}
}
View
4 vm/drivers/cli.cpp
@@ -110,8 +110,8 @@ int main(int argc, char** argv) {
return 1;
}
- env.halt();
- return env.exit_code();
+ env.halt(env.state);
+ return env.exit_code(env.state);
}
static void check_directory(std::string runtime) {
View
9 vm/environment.cpp
@@ -528,7 +528,12 @@ namespace rubinius {
delete cf;
}
- void Environment::halt() {
+ void Environment::halt_and_exit(STATE) {
+ halt(state);
+ exit(exit_code(state));
+ }
+
+ void Environment::halt(STATE) {
state->shared().tool_broker()->shutdown(state);
if(state->shared().config.ic_stats) {
@@ -561,7 +566,7 @@ namespace rubinius {
/**
* Returns the exit code to use when exiting the rbx process.
*/
- int Environment::exit_code() {
+ int Environment::exit_code(STATE) {
#ifdef ENABLE_LLVM
if(LLVMState* ls = shared->llvm_state) {
View
6 vm/environment.hpp
@@ -79,8 +79,10 @@ namespace rubinius {
void run_from_filesystem(std::string root);
void boot_vm();
- void halt();
- int exit_code();
+ void halt(STATE);
+ void halt_and_exit(STATE);
+ int exit_code(STATE);
+
void start_signals();
void start_agent(int port);
};
Please sign in to comment.
Something went wrong with that request. Please try again.