Project

threadlock

0.0
No commit activity in last 3 years
No release in over 3 years
Use the threadlock method in your class definition to automatically run instance methods inside of an instance-wide re-entrant lock (Monitor). All locked methods in an instance are protected by a single lock, unless a specific lock is specified. You can protect all or some of your methods from being run concurrently. In Ruby>=2.1, threadlock can also be used as a syntactic decorator. Enjoy.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

threadlock

Use the threadlock function in your class definition to automatically run instance methods inside of an instance-wide re-entrant lock (Monitor).

All locked methods in an instance are protect by a single lock. Alternatively, you can specify a custom lock, which need not be a Monitor; it can be anything that implements $synchronize

You can protect all or some of your methods from being run asynchronously.

In Ruby>=2.1, threadlock can also be syntactically used as a decorator.

See USAGE.rb for usage examples.

Enjoy.

Copyright 2013 : Joe McIlvain

(MIT License)