Using the suspend() and resume() Functions
The suspend() function can be called any number of times without an intervening call to resume(). The threaded runnable object maintains an internal count of the number of times the thread has been suspended. An equal number of calls to resume() must be made before the thread is allowed to continue. Both suspend() and resume() return the suspend-count that existed after the requested operation was performed.
The current suspend-count of a threaded runnable can be queried using the RWThread::getSuspendCount() function.