Skip to content
instance method

IO::Buffer#locked?

() -> bool
locked? → true or false

If the buffer is locked, meaning it is inside locked block execution. Locked buffer can’t be resized or freed, and another lock can’t be acquired on it.

Locking is not thread safe, but is a semantic used to ensure buffers don’t move while being used by a system call.

Example
buffer.locked do
  buffer.write(io) # theoretical system call interface
end
See also #locked #mapped? #internal? #not! also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1