```getThread()```函数返回通过参数指定threadId的```Thread```对象
```Thread```对象
getThread(threadId)
参数```threadId```为线程对象Id,通过指定参数获取对应的线程对象。
threadId
true
number
```javascript
function main() {
var t1 = threading.Thread(function () {
// Thread 对象有方法:id(),用于获取线程的Id,可以查看文档对应Thread对象的章节
var id = threading.currentThread().id()
var thread1 = threading.getThread(id)
Log("id:", id, ", thread1.id():", thread1.id())
Log(`id == thread1.id():`, id == thread1.id())
})
t1.join()
}
AprovaçãothreadId
Obtenha o objeto de thread indicado.
Suporte a sistemas de retrospecção, ambiente de disco real.
Se o fio que se espera ser obtido já tiver sido executado, o lançamento não pode ser executado.threading.getThread(threadId)
Objeto de thread para obter esse thread.
{@fun/Threads/threading/Thread Thread}, {@fun/Threads/threading/mainThread mainThread}, {@fun/Threads/threading/currentThread currentThread}, {@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}
Fios principalThread