```mainThread()```函数返回主线程的线程对象。
```Thread```对象
mainThread()
```javascript
function main() {
Log("主线程的threadId:", threading.mainThread().id())
}
O que é que é que eu faço?Thread
Objetos, para a saída do principalthreadId
。
function test() {
Log("test函数中输出主线程Id:", threading.mainThread().id())
}
function main() {
var t1 = threading.Thread(test)
t1.join()
}
Os objetos de threads dos threads principais também podem ser obtidos em threads paralelos.
Suporte a sistemas de retrospecção, ambiente de disco real.
{@fun/Threads/getThread getThread}, {@fun/Threads/threading/Thread Thread}, {@fun/Threads/threading/currentThread currentThread}, {@fun/Threads/threading/Lock Lock}, {@fun/Threads/threading/Condition Condition}, {@fun/Threads/threading/Event Event}, {@fun/Threads/threads/threading/Dict Dict}, {@fun/Threads/threading/pending pending}, {@fun/Threads/threading/eventLoop Loop}
getThread corrente