This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.

locked

        # IO::Buffer.locked

(from ruby core)
### Implementation from Buffer
---
    locked { ... }

---

Allows to process a buffer in exclusive way, for concurrency-safety.
While the block is performed, the buffer is considered locked, and no
other code can enter the lock. Also, locked buffer can't be changed with
#resize or #free.

    buffer = IO::Buffer.new(4)
    buffer.locked? #=> false

    Fiber.schedule do
      buffer.locked do
        buffer.write(io) # theoretical system call interface
      end
    end

    Fiber.schedule do
      # in `locked': Buffer already locked! (IO::Buffer::LockedError)
      buffer.locked do
        buffer.set_string(...)
      end
    end

The following operations acquire a lock: #resize, #free.

Locking is not thread safe. It is designed as a safety net around
non-blocking system calls. You can only share a buffer between threads
with appropriate synchronisation techniques.



      

This is MURDOC! A Ruby documentation browser inspired by Smalltalk-80. It allows you to learn about Ruby by browsing through its class hierarchies, and see any of its methods.