mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
*** empty log message ***
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@24 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5c47ddf9e7
commit
4da995929d
1 changed files with 23 additions and 20 deletions
|
@ -1,8 +1,8 @@
|
|||
#
|
||||
# finalizer.rb -
|
||||
# $Release Version: 0.2$
|
||||
# $Revision: 1.1.1.2.2.1 $
|
||||
# $Date: 1998/01/16 12:36:04 $
|
||||
# $Revision: 1.1.1.2.2.2 $
|
||||
# $Date: 1998/01/19 05:08:24 $
|
||||
# by Keiju ISHITSUKA
|
||||
#
|
||||
# --
|
||||
|
@ -44,7 +44,7 @@
|
|||
#
|
||||
|
||||
module Finalizer
|
||||
RCS_ID='-$Header: /home/cvsroot/ruby/lib/finalize.rb,v 1.1.1.2.2.1 1998/01/16 12:36:04 matz Exp $-'
|
||||
RCS_ID='-$Header: /home/cvsroot/ruby/lib/finalize.rb,v 1.1.1.2.2.2 1998/01/19 05:08:24 matz Exp $-'
|
||||
|
||||
# Dependency: {id => [[dependant, method, opt], ...], ...}
|
||||
Dependency = {}
|
||||
|
@ -159,10 +159,13 @@ module Finalizer
|
|||
def safe
|
||||
old_status, Thread.critical = Thread.critical, true
|
||||
ObjectSpace.remove_finalizer(Proc)
|
||||
begin
|
||||
yield
|
||||
ensure
|
||||
ObjectSpace.add_finalizer(Proc)
|
||||
Thread.critical = old_status
|
||||
end
|
||||
end
|
||||
|
||||
# ObjectSpace#add_finalizerへの登録関数
|
||||
def final_of(id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue