Guest User

Untitled

a guest
May 27th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. diff --git a/tdiary.rb b/tdiary.rb
  2. index e1808c7..3f04184 100644
  3. --- a/tdiary.rb
  4. +++ b/tdiary.rb
  5. @@ -106,15 +106,14 @@ end
  6. =begin
  7. == Safe module
  8. =end
  9. -require 'thread'
  10. module Safe
  11. def safe( level = 4 )
  12. result = nil
  13. if $SAFE < level then
  14. - Thread.start {
  15. + Proc.new {
  16. $SAFE = level
  17. result = yield
  18. - }.join
  19. + }.call
  20. else
  21. result = yield
  22. end
Add Comment
Please, Sign In to add comment