Skip to content

Commit

Permalink
use Proc instead of Thread for changing safe level
Browse files Browse the repository at this point in the history
  • Loading branch information
machu committed Jun 5, 2010
1 parent 3f72452 commit eb6bf1c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tdiary.rb
Expand Up @@ -106,15 +106,14 @@ module QueryExtension
=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
Expand Down

0 comments on commit eb6bf1c

Please sign in to comment.