Class FSDB::Mutex
In: lib/fsdb/mutex.rb
Parent: Object

Mutex class based on standard thread.rb Mutex, which has some problems:

  • waiters are not a strict queue (try_lock can jump the queue, after which the queue gets rotated). Race condition.
  • doesn’t use Thread.exclusive in enough places
  • no way to make dead threads give up the mutex, which is crucial in a fork

Note: neither this Mutex nor the one in thread.rb is nestable.

Methods

lock   locked?   new   synchronize   try_lock   unlock  

Classes and Modules

Module FSDB::Mutex::ForkSafely

Public Class methods

Public Instance methods

[Validate]