Last Modified
2014-07-30 22:31:34 -0700
Requires

Description

sync.rb - 2 phase lock with counter
    $Release Version: 1.0$
    $Revision: 40825 $
    by Keiju ISHITSUKA(keiju@ishitsuka.com)

Sync_m, Synchronizer_m
Usage:
 obj.extend(Sync_m)
 or
 class Foo
     include Sync_m
     :
 end

 Sync_m#sync_mode
 Sync_m#sync_locked?, locked?
 Sync_m#sync_shared?, shared?
 Sync_m#sync_exclusive?, sync_exclusive?
 Sync_m#sync_try_lock, try_lock
 Sync_m#sync_lock, lock
 Sync_m#sync_unlock, unlock

Sync, Synchronizer:
Usage:
 sync = Sync.new

 Sync#mode
 Sync#locked?
 Sync#shared?
 Sync#exclusive?
 Sync#try_lock(mode) -- mode = :EX, :SH, :UN
 Sync#lock(mode)     -- mode = :EX, :SH, :UN
 Sync#unlock
 Sync#synchronize(mode) {...}

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus