kernel: msg: async messages no longer hold a pointer to the thread/port that sent them
this prevents a race condition where an event is sent as a port is being destroyed. when the server gets around to handling the event, it now refers to a different port that was created in the mean-time.
This commit is contained in:
+14
-2
@@ -21,8 +21,20 @@ struct msg {
|
||||
enum kmsg_status msg_status;
|
||||
struct btree_node msg_node;
|
||||
msgid_t msg_id;
|
||||
struct port *msg_sender_port;
|
||||
struct thread *msg_sender_thread;
|
||||
union {
|
||||
/* only valid for asynchronous messages (msg_status ==
|
||||
* KMSG_ASYNC) */
|
||||
struct {
|
||||
koid_t msg_sender_port_id;
|
||||
tid_t msg_sender_thread_id;
|
||||
};
|
||||
/* only valid for synchronous messages (msg_status !=
|
||||
* KMSG_ASYNC) */
|
||||
struct {
|
||||
struct port *msg_sender_port;
|
||||
struct thread *msg_sender_thread;
|
||||
};
|
||||
};
|
||||
kern_status_t msg_result;
|
||||
kern_msg_type_t msg_type;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user