The resource loading... loading...

Thread.join-return

This JSON is the data structure returned by the member function join() of the Thread object, which saves some information about concurrent threads in the JavaScript language strategy. The Thread object refers to the thread object, which is created by threading.Thread().

Thread Id. id number Whether the thread is forced to end. terminated bool The running time of the thread in nanoseconds. elapsed number The return value of the thread function. ret number

The following code tests the timeout mechanism of the join() function of the Thread object and prints the return value of the join() function.

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}
} ```


{@fun/Threads/Thread/join join}
DBExec-return Built-in variables