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 -
|
# finalizer.rb -
|
||||||
# $Release Version: 0.2$
|
# $Release Version: 0.2$
|
||||||
# $Revision: 1.1.1.2.2.1 $
|
# $Revision: 1.1.1.2.2.2 $
|
||||||
# $Date: 1998/01/16 12:36:04 $
|
# $Date: 1998/01/19 05:08:24 $
|
||||||
# by Keiju ISHITSUKA
|
# by Keiju ISHITSUKA
|
||||||
#
|
#
|
||||||
# --
|
# --
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
module Finalizer
|
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: {id => [[dependant, method, opt], ...], ...}
|
||||||
Dependency = {}
|
Dependency = {}
|
||||||
|
@ -159,9 +159,12 @@ module Finalizer
|
||||||
def safe
|
def safe
|
||||||
old_status, Thread.critical = Thread.critical, true
|
old_status, Thread.critical = Thread.critical, true
|
||||||
ObjectSpace.remove_finalizer(Proc)
|
ObjectSpace.remove_finalizer(Proc)
|
||||||
yield
|
begin
|
||||||
ObjectSpace.add_finalizer(Proc)
|
yield
|
||||||
Thread.critical = old_status
|
ensure
|
||||||
|
ObjectSpace.add_finalizer(Proc)
|
||||||
|
Thread.critical = old_status
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# ObjectSpace#add_finalizerへの登録関数
|
# ObjectSpace#add_finalizerへの登録関数
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue