Modify task::join to indicate how the task terminated
This involves sticking yet another field into the task structure
This commit is contained in:
parent
d9cc4cb81b
commit
ced8393f20
6 changed files with 43 additions and 6 deletions
|
@ -410,7 +410,7 @@ task_yield(rust_task *task) {
|
|||
task->yield(1);
|
||||
}
|
||||
|
||||
extern "C" CDECL void
|
||||
extern "C" CDECL intptr_t
|
||||
task_join(rust_task *task, rust_task *join_task) {
|
||||
// If the other task is already dying, we don't have to wait for it.
|
||||
join_task->lock.lock();
|
||||
|
@ -423,6 +423,11 @@ task_join(rust_task *task, rust_task *join_task) {
|
|||
else {
|
||||
join_task->lock.unlock();
|
||||
}
|
||||
if (!join_task->failed) {
|
||||
return 0;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" CDECL void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue