The currentThread()
function is used to get the thread object of the current thread.
The currentThread()
function returns the thread object of the current thread.
Thread
object
currentThread()
function test() {
Log("Id of the current thread:", threading.currentThread().id())
}
function main() {
var t1 = threading.Thread(test)
t1.join()
}
Get the Thread
object of the current thread and output the threadId
of the current thread.
It supports backtesting system and live trading environment.
{@fun/Threads/threading/Thread Thread}, {@fun/Threads/threading/mainThread mainThread}, {@fun/Threads/threading/Thread Thread}, {@fun/Threads/threading/Lock Lock}, {@fun/Threads/threading/Condition Condition}, {@fun/Threads/threading/Event Event}, {@fun/Threads/threading/Dict Dict}, {@fun/Threads/threading/pending pending}, {@fun/Threads/threading/eventLoop eventLoop}
mainThread Lock