```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()
}
AprobadothreadId
Obtener el objeto del hilo especificado.
Apoya sistemas de retrospección, entornos de disco real.
Si el hilo que se espera obtener ya ha sido ejecutado, se puede eliminar.threading.getThread(threadId)
Objeto de hilo de ese hilo.
{@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 Loop}
El hilo Enlace principal