[Xorp-hackers] waiting for a callback return
cevhers at gmail.com
Tue Jul 1 11:50:09 PDT 2008
I want to call an xrl method of a process X in the middle of a function
defined in some other process Y.
The callback function defined in Y which processes the values returned by X
simply sets a boolean variable VAR to TRUE if the value of XrlError object
Below is how I called the xrl method of process X in Y, and wait for the
callback to return:
// Do nothing
// When VAR becomes true, do something
where send_request(argument_list) is a local function in Y which calls
the xrl method in the client interface of process X till the request has
been successfully sent (As expected, it also sends across the name of the
callback function in Y).
VAR is set to TRUE when the callback in Y is called with an argument of
However, waiting in a while loop for VAR to become TRUE through the callback
in Y even prevents the xrl_method handler in process X from being called.
Hence, the while loop above turns into an infinite loop since VAR will never
be set to TRUE by the callback in Y.
What is the proper way other than a while loop like above for waiting for
VAR to become true ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Xorp-hackers