English
Object «Threading»
This article is automatically translated from Russian by Google Translator.
Provides management of parallel threads.
Method
Description
Waiting for the specified flow to complete.
Finishes the execution of the specified flow.
Queries the received message.
Sends a message to the specified stream.
Runs the function passed as a parameter in a separate thread.

joinThread

Waiting for the specified flow to complete.

Syntax

JavaScript
Threading.joinThread("threadId");
As a parameter, it is necessary to specify thread id.

killThread

Finishes the execution of the specified flow.

Syntax

JavaScript
Threading.killThread("threadId");
The thread id must be specified as a parameter.

receiveMessage

Queries the received message.

Syntax

JavaScript
Threading.receiveMessage(wait);
If wait is true, it waits until a message arrives.

sendMessage

Sends a message to the specified stream.

Syntax

JavaScript
Threading.sendMessage("threadId", "message");
As parameters, it is necessary to specify thread id and message.

startThread

Runs the function passed as a parameter in a separate thread.
Warning! This creates a new copy for all global variables. So if the value of a variable change in one thread, it stays the same in another thread.

Syntax

JavaScript
Threading.startThread("newThreadId", "functionName");
As parameters, it is necessary to specify thread id and function.
Export as PDF
Copy link
On this page
joinThread
killThread
receiveMessage
sendMessage
startThread