```getData()```函数返回当前线程环境中储存的键-值对中```key```参数对应的键值。
string、number、bool、object、array、空值等系统支持的所有类型
getData()
getData(key)
```key```参数为储存的键-值对的键名。
key
true
string
```javascript
function main() {
var t1 = threading.Thread(function() {
for (var i = 0; i < 5; i++) {
threading.currentThread().setData("count", i)
Log(`setData("count"):`, i)
Sleep(1000)
}
})
for (var i = 0; i < 5; i++) {
var count = threading.getThread(t1.id()).getData("count")
Log(`getData("count"):`, count)
Sleep(1000)
}
t1.join()
}
সমান্তরাল থ্রেডের পরিবেশে রেকর্ড কী নামকরণ করা হয়count
এবং তারপর মূল থ্রেডে পাঠানো হয়count
{@fun/Threads/Thread/peekMessage peekMessage}, {@fun/Threads/Thread/postMessage postMessage}, {@fun/Threads/Thread/join join}, {@fun/Threads/Thread/terminate terminate}, {@fun/Threads/Thread/setData set}, {@fun/Threads/Thread/id id}, {@fun/Threads/Thread/name name name}, {@fun/Threads/Thread/eventLoop eventLoop}, {@fun/Threads/Thread/eventLoop eventLoop}, {@fun/Threads/Thread/eventLoop eventLoop}, {@fun/Threads/eventLoop eventLoop}, {@fun/Threads/eventLoop eventLoop}, {@fun/Threads/eventLoop eventLoop}, {@fun/Threads/eventLoop eventLoop}, {@fun
শেষ করা সেটডাটা