Type/to search
Built-in Functions
Structures
Ticker
Depth
OrderBook
Trade
Record
Market
Order
Condition
Account
Asset
Position
Funding
Other Structures
HttpQuery-options
HttpQuery-return
LogStatus-table
LogStatus-btnTypeOne
LogStatus-btnTypeTwo
Status Bar Components
Chart-options
Chart-return
KLineChart-options
KLineChart-return
SetData-data
EventLoop-return
exchange.Go-return
DBExec-return
Dial-return
Thread.join-return
Built-in Variables and Constants
Conventions
Exchanges

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

NameTypeDescription

id

number

Thread ID.

terminated

bool

Whether the thread was forcibly terminated.

elapsed

number

Thread execution time (nanoseconds).

error

string

Error message when the thread fails (throws an exception); null when there is no error.

ret

any

Return value of the thread function, which can be of any type; undefined when the thread function returns nothing.

See Also

Remarks

join(timeout) returns undefined (not null) when the thread has not finished within the timeout; you can call join() again later to keep waiting. 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,"error":null} }