Multithreading

Operators and functions for working with threads (thread type) are described here.

Operators

Operator

Result

Description

thread = thread

Assignment operator.

Functions

resume(thread th)

The resume function continues the work of the thread that was stopped by suspend function.

sleep(int duration)

The sleep function pauses the current thread for at least the duration, in milliseconds.

suspend(thread th)

The suspend function suspends the th thread. Use the resume function to continue the thread.

terminate(thread th)

The terminate function terminates the thread. If the thread has already completed, the function does nothing.

wait(thread th)

The wait function waits for the th thread to finish. If the thread has already finished, the function does nothing.