diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-05-31 23:25:13 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-05-31 23:47:52 -0700 |
| commit | 4c8bc19ad2d5b9a51febf916a2a93b07da146385 (patch) | |
| tree | 279186722b249a2736f754007497b9ff66fab813 /src/rt/rust_task.h | |
| parent | e47962f6a9fdbac2054c15fea8953c2338e8e115 (diff) | |
| download | rust-4c8bc19ad2d5b9a51febf916a2a93b07da146385.tar.gz rust-4c8bc19ad2d5b9a51febf916a2a93b07da146385.zip | |
rt: Refactor task failure to go through rust_task_fail
This is the place to but a breakpoint. We will raise SIGINT here to break into the debugger.
Diffstat (limited to 'src/rt/rust_task.h')
| -rw-r--r-- | src/rt/rust_task.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h index 69a56e425de..4ad13472024 100644 --- a/src/rt/rust_task.h +++ b/src/rt/rust_task.h @@ -97,6 +97,12 @@ struct task_notification { task_result result; // task_result }; +extern "C" void +rust_task_fail(rust_task *task, + char const *expr, + char const *file, + size_t line); + struct rust_task : public kernel_owned<rust_task>, rust_cond { @@ -181,11 +187,19 @@ private: rust_cond *cond, const char* cond_name); bool must_fail_from_being_killed_unlocked(); + // Called by rust_task_fail to unwind on failure + void begin_failure(char const *expr, + char const *file, + size_t line); friend void task_start_wrapper(spawn_args *a); friend void cleanup_task(cleanup_args *a); friend void reset_stack_limit_on_c_stack(reset_args *a); friend void new_stack_slow(new_stack_args *a); + friend void rust_task_fail(rust_task *task, + char const *expr, + char const *file, + size_t line); public: @@ -231,6 +245,7 @@ public: // Fail self, assuming caller-on-stack is this task. void fail(); + void fail(char const *expr, char const *file, size_t line); void conclude_failure(); void fail_parent(); |
