I have a background thread that occasionally does something with Views,
so I have this executing using runonuithread like so:
bool success = false;
RunOnUiThread(() => success = ExecuteRemoteCommand(command, parameter));
I need to wait for the result from the ExecuteRemoteCommand before
continuing (it doesn't matter that this is blocking).
What is the best way to do that?
I thought of spinning a While loop like:
int success = 0;
RunOnUiThread(() => success = ExecuteRemoteCommand(command, parameter));
while (success ==0)
{
Thread.Sleep(1000);
}
....and making ExecuteRemoteCommand return <> 0 instead of true/false.
Is there a better way?
Thanks,
Martyn
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
______________________________________________________________________
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid