From 161e3313d20eb285c8cfc3288e92a6d2e533cf44 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 26 Jan 2001 05:02:19 +0000 Subject: * parse.y: clarify do ambiguity, bit more complex but natural from my point of view. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/tempfile.rb | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'lib/tempfile.rb') diff --git a/lib/tempfile.rb b/lib/tempfile.rb index ab97f457a8..0b22de260a 100644 --- a/lib/tempfile.rb +++ b/lib/tempfile.rb @@ -15,16 +15,19 @@ class Tempfile < SimpleDelegator Max_try = 10 def Tempfile.callback(path, data) + pid = $$ lambda{ - print "removing ", path, "..." if $DEBUG - data[0].close if data[0] - if File.exist?(path) - File.unlink(path) - end - if File.exist?(path + '.lock') - Dir.rmdir(path + '.lock') + if pid == $$ + print "removing ", path, "..." if $DEBUG + data[0].close if data[0] + if File.exist?(path) + File.unlink(path) + end + if File.exist?(path + '.lock') + Dir.rmdir(path + '.lock') + end + print "done\n" if $DEBUG end - print "done\n" if $DEBUG } end -- cgit v1.2.3