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
ThreadLock
ThreadLock.acquire
ThreadLock.release
ThreadEvent
ThreadCondition
ThreadDict
Server
TA
Talib
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

Requests a thread lock (acquire lock).

acquire()
acquire(timeout)

Returns

TypeDescription

bool

Returns true when the lock is acquired, false on timeout.

Arguments

NameTypeRequiredDescription

timeout

number

No

Timeout for acquiring the lock, in milliseconds. If omitted, or less than or equal to 0, it waits until the lock is acquired.

See Also

Remarks

The acquire() function is used to request a thread lock. When a thread calls the acquire() function of a thread lock object, it attempts to acquire the lock. If the lock is not currently held by another thread, the calling thread will successfully acquire the lock and continue execution. If the lock is already held by another thread, the thread calling acquire() will be blocked until the lock is released.