]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/rm-lld.git/blobdiff - src/rm_services.c
Fixed task blocking routine not working more than once
[keystone-rtos/rm-lld.git] / src / rm_services.c
index 3a2b7844394db33987a22179fc9a0f1a43aabc98..c689ee4a3f5de036806755fdf61b543f0f84a38b 100644 (file)
  ********************** Internal Functions ****************************
  **********************************************************************/
 
+/* FUNCTION PURPOSE: Internal Callback to unblock RM instance
+ ***********************************************************************
+ * DESCRIPTION: Internal callback function executed when the result
+ *              of a service request has been received from a remote
+ *              instance.  The original service request did not specify
+ *              a callback function so the Rm_serviceHandler is blocked
+ *              waiting for the response.  This function unblocks the
+ *              Rm_serviceHandler to return the response to the 
+ *              application.
+ */
 void rmServiceInternalCallback(Rm_Handle rmHandle)
 {
     Rm_Inst *rmInst = (Rm_Inst *)rmHandle;
 
-    /* Unblock so the serviceHandler can provide the response to the application */
-    Rm_osalLocalGateLeave(rmInst->localGateKey);
+    /* Unblock so Rm_serviceHandler can provide response to application */
+    Rm_osalTaskUnblock(rmInst->blockHandle);
 }
 
 /**********************************************************************
@@ -118,7 +128,7 @@ void Rm_serviceHandler (void *rmHandle, const Rm_ServiceReqInfo *serviceRequest,
 
         if ((transaction->state == RM_SERVICE_PROCESSING) && (transaction->callback.serviceCallback == NULL)) {
             /* Block until response is received.  Response will be received in transaction. */
-            rmInst->localGateKey = Rm_osalLocalGateEnter();
+            Rm_osalTaskBlock(rmInst->blockHandle);
         }
 
         serviceResponse->rmHandle = rmHandle;