Skip to content

Instantly share code, notes, and snippets.

@machu
Created June 5, 2010 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save machu/426394 to your computer and use it in GitHub Desktop.
Save machu/426394 to your computer and use it in GitHub Desktop.
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