From 57ed4bbb517b383e0da149688802ce9b77d29392 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Tue, 29 Jun 2010 12:08:37 +0000 Subject: [PATCH] MF_REPLY_PEND should be removed when sendrec finishes (r7565 from trunk) --- kernel/proc.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/kernel/proc.c b/kernel/proc.c index 70983478c..49ed85b87 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -561,6 +561,10 @@ PUBLIC int mini_send( call = (caller_ptr->p_misc_flags & MF_REPLY_PEND ? SENDREC : (flags & NON_BLOCKING ? SENDNB : SEND)); IPC_STATUS_ADD_CALL(dst_ptr, call); + + if (dst_ptr->p_misc_flags & MF_REPLY_PEND) + dst_ptr->p_misc_flags &= ~MF_REPLY_PEND; + RTS_UNSET(dst_ptr, RTS_RECEIVING); } else { if(flags & NON_BLOCKING) { @@ -679,7 +683,7 @@ PRIVATE int mini_receive( IPC_STATUS_ADD_CALL(caller_ptr, NOTIFY); - return(OK); + goto receive_done; } } @@ -693,7 +697,7 @@ PRIVATE int mini_receive( if (r == OK) { IPC_STATUS_ADD_CALL(caller_ptr, SENDA); - return OK; /* Got a message */ + goto receive_done; } } @@ -731,7 +735,7 @@ PRIVATE int mini_receive( *xpp = sender->p_q_link; /* remove from queue */ sender->p_q_link = NULL; - return(OK); /* report success */ + goto receive_done; } xpp = &sender->p_q_link; /* proceed to next */ } @@ -752,6 +756,11 @@ PRIVATE int mini_receive( } else { return(ENOTREADY); } + +receive_done: + if (caller_ptr->p_misc_flags & MF_REPLY_PEND) + caller_ptr->p_misc_flags &= ~MF_REPLY_PEND; + return OK; } /*===========================================================================* -- 2.44.0