No commit activity in last 3 years
No release in over 3 years
aop for ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 0
 Project Readme

roap_thread_safe

메소드에 thread-safe 속성을 추가하여 해당 메소드를 스레드에 안전하게 만들 수 있습니다.
thread-safe 처리된 메소드는 인스턴스 단위로 생성되는 Mutex 잠금에 의해 동기화됩니다.
http://www.rubyinside.com/does-the-gil-make-your-ruby-code-thread-safe-6051.html

Installation

gem install roap_thread_safe

Usage

(아래의 예시는 MRI 환경에서 원래 thread-safe한 코드지만 간단한 예제를 위해 작성함)

class Counter
  def initialize
    @cnt = 0
  end
  
  #thread-safe
  def step
    @cnt += 1
  end
  
  #thread-safe
  def count
    @cnt
  end
end