MF_REPLY_PEND should be removed when sendrec finishes

(r7565 from trunk)
This commit is contained in:
Ben Gras 2010-06-29 12:08:37 +00:00
parent cb800f32dc
commit 57ed4bbb51

View File

@ -561,6 +561,10 @@ PUBLIC int mini_send(
call = (caller_ptr->p_misc_flags & MF_REPLY_PEND ? SENDREC call = (caller_ptr->p_misc_flags & MF_REPLY_PEND ? SENDREC
: (flags & NON_BLOCKING ? SENDNB : SEND)); : (flags & NON_BLOCKING ? SENDNB : SEND));
IPC_STATUS_ADD_CALL(dst_ptr, call); 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); RTS_UNSET(dst_ptr, RTS_RECEIVING);
} else { } else {
if(flags & NON_BLOCKING) { if(flags & NON_BLOCKING) {
@ -679,7 +683,7 @@ PRIVATE int mini_receive(
IPC_STATUS_ADD_CALL(caller_ptr, NOTIFY); IPC_STATUS_ADD_CALL(caller_ptr, NOTIFY);
return(OK); goto receive_done;
} }
} }
@ -693,7 +697,7 @@ PRIVATE int mini_receive(
if (r == OK) { if (r == OK) {
IPC_STATUS_ADD_CALL(caller_ptr, SENDA); 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 */ *xpp = sender->p_q_link; /* remove from queue */
sender->p_q_link = NULL; sender->p_q_link = NULL;
return(OK); /* report success */ goto receive_done;
} }
xpp = &sender->p_q_link; /* proceed to next */ xpp = &sender->p_q_link; /* proceed to next */
} }
@ -752,6 +756,11 @@ PRIVATE int mini_receive(
} else { } else {
return(ENOTREADY); return(ENOTREADY);
} }
receive_done:
if (caller_ptr->p_misc_flags & MF_REPLY_PEND)
caller_ptr->p_misc_flags &= ~MF_REPLY_PEND;
return OK;
} }
/*===========================================================================* /*===========================================================================*