mirror of https://github.com/l4ka/pistachio.git
return correct propagated thread ID to receiver when propagator and receiver are local to one another
In the case of a propagated message, current->get_partner()'s result may not refer to the same thread as from_tcb->get_{local,global}_id(). This changeset narrows the case where local TIDs are returned to avoid this confusion. This changeset also makes explicit (through the use of an ASSERT()) the assumption that only global IDs are passed through propagation.
This commit is contained in:
parent
8220bfaf0b
commit
e0f663d465
|
@ -438,6 +438,7 @@ send_path:
|
|||
#endif
|
||||
|
||||
// The partner must be told who the IPC originated from.
|
||||
ASSERT(!tag.is_propagated() || sender_id.is_global());
|
||||
to_tcb->set_partner(sender_id);
|
||||
|
||||
if (EXPECT_FALSE( !transfer_message(current, to_tcb, tag) ))
|
||||
|
@ -728,8 +729,13 @@ send_path:
|
|||
}
|
||||
current->set_state(thread_state_t::running);
|
||||
#if defined(HANDLE_LOCAL_IDS)
|
||||
if (current->get_space () == from_tcb->get_space ())
|
||||
// only global TIDs are passed through propagation, hence the test
|
||||
// against from_tcb->get_global_id().
|
||||
if (current->get_space () == from_tcb->get_space ()
|
||||
&& current->get_partner() == from_tcb->get_global_id())
|
||||
{
|
||||
return_ipc (from_tcb->get_local_id ());
|
||||
}
|
||||
#endif
|
||||
return_ipc(current->get_partner());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue