From 7277cd71984e6a09bc2f8a8a828a5e213b485d00 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 15 May 2012 11:34:52 -0700 Subject: core: Add task::unkillable --- src/rt/rust_task.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/rt/rust_task.cpp') diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index d7c62780fbb..823937443b5 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -37,6 +37,7 @@ rust_task::rust_task(rust_sched_loop *sched_loop, rust_task_state state, cond_name("none"), killed(false), reentered_rust_stack(false), + disallow_kill(false), c_stack(NULL), next_c_sp(0), next_rust_sp(0), @@ -211,7 +212,7 @@ rust_task::must_fail_from_being_killed() { bool rust_task::must_fail_from_being_killed_unlocked() { kill_lock.must_have_lock(); - return killed && !reentered_rust_stack; + return killed && !reentered_rust_stack && !disallow_kill; } // Only run this on the rust stack @@ -645,6 +646,16 @@ rust_task::on_rust_stack() { } } +void +rust_task::inhibit_kill() { + disallow_kill = true; +} + +void +rust_task::allow_kill() { + disallow_kill = false; +} + // // Local Variables: // mode: C++ -- cgit 1.4.1-3-g733a5