First of all, thanks to all who have answered my previous questions.
I have an app with a main task & a download task. The download task does an adl_adSubscribe and gets a -22. So I initiate a recompact. But I want to wait until the recompact finishes before continuing. My most recent attempt is to set a global variable for the main task, then have the download task adl_ctxSuspend itself. The main program’s timer handler sees the change in the global, sets up an event handler for the recompact, then starts the recompact. The event handler does the adl_ctxResume on receiving ADL_AD_EVENT_RECOMPACT_DONE.
However, the adl_ctxSuspend never suspends the task. Nor does it return an error. Seems like adl_ctxSuspend doesn’t work on its own task.
How can one wait in one task for the completion of an asynchronous operation in another task?