Type/to search
Built-in Functions
Global
Log
Market
Trade
Account
Futures
Exchange
IO
Network
Storage
Threads
exchange.Go
EventLoop
ctx.subscribe
ctx.poll
ctx.order
ctx.cancel
ctx.submit
Subscription
threading
Thread
Thread.peekMessage
Thread.postMessage
Thread.join
Thread.terminate
Thread.getData
Thread.setData
Thread.id
Thread.name
Thread.eventLoop
ThreadLock
ThreadEvent
ThreadCondition
ThreadDict
Server
TA
Talib
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

Forcibly terminates a thread and releases the hardware resources occupied when the thread was created.

terminate()

Examples

Forcibly terminate the execution of a thread. After forcibly terminating the thread, the content output by that thread will no longer be displayed in the logs.

javascript
function main() { var t1 = threading.Thread(function() { for (var i = 0; i < 10; i++) { Log("thread1 i:", i) Sleep(1000) } }) Sleep(3000) t1.terminate() Log("after t1.terminate()") while (true) { LogStatus(_D()) Sleep(1000) } }

See Also

Remarks

A thread forcibly terminated with the terminate() function can still be joined; join() returns promptly with terminated set to true.