Index: ChangeLog =================================================================== --- ChangeLog (revision 3796) +++ ChangeLog (working copy) @@ -1,3 +1,11 @@ +2008-05-17 Philippe Gerum + + * ksrc/skins/native/task.c (rt_task_send): Apply infinite timeout + to wait for a reply once a remote server has been found, in the + non-blocking call case. NOTE: Passing TM_NONBLOCK does NOT mean + not to wait for a reply, but it means to wait for a reply UNLESS + no server is listening to us before we send the request. + 2008-05-15 Philippe Gerum * src/skins/vxworks, ksrc/skins/vxworks: Add taskInfoGet() Index: ksrc/skins/native/task.c =================================================================== --- ksrc/skins/native/task.c (revision 3796) +++ ksrc/skins/native/task.c (working copy) @@ -1691,7 +1691,8 @@ * remote task eventually replies. Passing TM_NONBLOCK causes the * service to return immediately without waiting if the remote task is * not waiting for messages (i.e. if @a task is not currently blocked - * on the rt_task_receive() service). + * on the rt_task_receive() service); however, the caller will wait + * indefinitely for a reply from that remote task if present. * * @return A positive value is returned upon success, representing the * length (in bytes) of the reply message returned by the remote @@ -1718,6 +1719,9 @@ * from a context which cannot sleep (e.g. interrupt, non-realtime or * scheduler locked). * + * - -ESRCH is returned if @a task cannot be found (when called from + * user-space only). + * * Environments: * * This service can be called from: @@ -1755,10 +1759,17 @@ goto unlock_and_exit; } - if (timeout == TM_NONBLOCK && xnsynch_nsleepers(&task->mrecv) == 0) { - /* Can't block and no server listening; just bail out. */ - err = -EWOULDBLOCK; - goto unlock_and_exit; + if (timeout == TM_NONBLOCK) { + if (xnsynch_nsleepers(&task->mrecv) == 0) { + /* Can't block and no server listening; just bail out. */ + err = -EWOULDBLOCK; + goto unlock_and_exit; + } else + /* + * Make sure we'll wait indefinitely once we + * know that a remote task is listening. + */ + timeout = TM_INFINITE; } if (xnpod_unblockable_p()) {