Mojo struct
BlockingScopedLock
A scope adapter for BlockingSpinLock.
Aliases
LockType = BlockingSpinLock
: The type of the lock.
Fields
- lock (
UnsafePointer[BlockingSpinLock]
): The underlying lock instance.
Implemented traits
AnyType
Methods
__init__
__init__(out self, lock: UnsafePointer[BlockingSpinLock])
Primary constructor.
Args:
- lock (
UnsafePointer[BlockingSpinLock]
): A pointer to the underlying lock.
__init__(out self, inout lock: BlockingSpinLock)
Secondary constructor.
Args:
- lock (
BlockingSpinLock
): A mutable reference to the underlying lock.
__enter__
__enter__(inout self)
Acquire the lock on entry. This is done by setting the owner of the lock to own address.
__exit__
__exit__(inout self)
Release the lock on exit. Reset the address on the underlying lock.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!