How to block an API call without blocking server message loop?

Valery V. Sedletski _valerius at
Sun Apr 3 22:22:07 CEST 2011

On Sat, 02 Apr 2011 12:58:34 +1300 (MSD), Valery V. Sedletski wrote:

>Hi all.

I have rethought the problem and, it seems, found the solution -- still block on a semaphore, but not in server stub, but 
in the client routine which calls the RPC to the server. 

But the problem remains -- the semaphore is in the server, but need to share it with the client for it to reset it. -- So the next 
question arises -- how to tell DICE to map the semaphore to the client? -- I have the semaphore in the server, and trying
to return it from the RPC to the server. But DICE returns a copy of the semaphore, and not maps it to the client. I try to use
the following IDL declaration:

    APIRET dos_ExecPgm ([out, string,
			prealloc_server] char **pObjname,
                        [in] long cbObjname,
		        [in] unsigned long execFlag,
		        [in, string] char *pArg,
		        [in, string] char *pEnv,
		        [in, out] struct _RESULTCODES *pRes,
                        [out, size_is(len), ref,
			prealloc_server] l4semaphore_t **tSem,
			[out] int *len,
		        [in, string] char *pName);

-- so, I'm trying to use 'ref' attribute for tSem. But in that case, DICE requires me to specify the array with 'len' parameter. Can I avoid
this length parameter? (I must return one l4semaphore_t * value from the IDL method, and get the mapping of original semaphore,
not its copy).

So, any help is appreciated.


More information about the l4-hackers mailing list