Built-in Functions
Structures
Built-in Variables
Thread.join-return
This JSON is the data structure returned by the join() member function of the Thread object, used to store information related to concurrent threads in JavaScript language strategies. The Thread object refers to a thread object created via threading.Thread().
Attributes
| Name | Type | Description |
id | number | Thread ID. |
terminated | bool | Whether the thread was forcibly terminated. |
elapsed | number | Thread execution time (nanoseconds). |
ret | number | Return value of the thread function. |
See Also
Remarks
The following code tests the timeout mechanism of the join() function of the Thread object and prints the return value of the join() function.
javascript
function testFunc() {
for (var i = 0; i < 5; i++) {
Log(i)
Sleep(300)
}
}
function main() {
var t1 = threading.Thread(testFunc)
Log(t1.join(1000)) // undefined
Log(t1.join()) // {"id":1,"terminated":false,"elapsed":1506864000}
}