Thread termination and pending events

I have a task class that uses a timer to allow the thread to update the UI via a main-thread method. I was finding, however, that if the last thing the thread was doing was such an action, the UI didn’t get this final update. So I added:

me.sleep (100)

at the end of the task to take care of that. Am I right in thinking that the thread termination sequence kills off any pending events? If so, is there a way to wait for all pending events to complete? I did wonder about:

me.sleep (10000, true)

(provided I’m not waiting for network-related events).

Also: if I want to give up early in a thread, what is the recommended way to do that? Just use return, or perhaps me.kill() ?

Just returning from Run is enough. Kill is normally used from outside of a thread, and stops it immediately.

I wouldn’t expect that. Threads don’t get destroyed unless they go out of scope.