Sha256: f573b501601ed910ceb8717f3a16440cc8df04cbda3254ef5e479ac311580e10
Contents?: true
Size: 732 Bytes
Versions: 4
Compression:
Stored size: 732 Bytes
Contents
# Copyright: Copyright (c) 2004 Nicolas Despres. All rights reserved. # Author: Nicolas Despres <polrop@lrde.epita.fr>. # License: Gnu General Public License. # $LastChangedBy: polrop $ # $Id: object_monitor_activity.rb 105 2005-01-16 17:42:26Z polrop $ require 'observable' class ObjectMonitorActivity include Observable def initialize @mutex = Mutex.new @activity = {} end def update(msg, info) case msg when :start_method: @mutex.synchronize { @activity[info[:num]] = info } when :stop_method: @mutex.synchronize { @activity.delete(info[:num]) } else raise 'unknown message' end end def snapshot @mutex.synchronize { @activity.dup } end end # class ObjectMonitorActivity
Version data entries
4 entries across 4 versions & 2 rubygems