Created
June 5, 2010 07:14
-
-
Save machu/426394 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tdiary.rb b/tdiary.rb | |
index e1808c7..3f04184 100644 | |
--- a/tdiary.rb | |
+++ b/tdiary.rb | |
@@ -106,15 +106,14 @@ end | |
=begin | |
== Safe module | |
=end | |
-require 'thread' | |
module Safe | |
def safe( level = 4 ) | |
result = nil | |
if $SAFE < level then | |
- Thread.start { | |
+ Proc.new { | |
$SAFE = level | |
result = yield | |
- }.join | |
+ }.call | |
else | |
result = yield | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment