<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -23,6 +23,7 @@ module Innate
   require 'pp'
   require 'set'
   require 'socket'
+  require 'thread'
   require 'uri'
 
   # 3rd party</diff>
      <filename>lib/innate.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,8 @@
 require 'thread'
 
 module Innate
+  SEMAPHORE = Mutex.new
+
   module SingletonMethods
     # Use this method to achieve thread-safety for sensitive operations.
     #
@@ -9,9 +11,8 @@ module Innate
     # execution of this method.
     #
     # @param [Proc] block the things you want to execute
-    # @see State::Thread#sync State::Fiber#sync
     def sync(&amp;block)
-      Thread.exclusive(&amp;block)
+      SEMAPHORE.synchronize(&amp;block)
     end
 
     def defer</diff>
      <filename>lib/innate/state.rb</filename>
    </modified>
    <modified>
      <diff>@@ -49,10 +49,10 @@ module Innate
     # on the first request (before TEMP is set).
     # No mutex is used in Fiber environment, see Innate::State and subclasses.
     def obtain(klass, root = Object)
-      Thread.exclusive{
+      Innate.sync do
         klass.to_s.scan(/\w+/){|part| root = root.const_get(part) }
         return root
-      }
+      end
     end
 
     # Reads the specified view template from the filesystem. When the read_cache</diff>
      <filename>lib/innate/view.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1b80af613098682ba0da340002e8d850e333cfc4</id>
    </parent>
  </parents>
  <author>
    <name>Michael Fellinger</name>
    <email>m.fellinger@gmail.com</email>
  </author>
  <url>http://github.com/jeremyz/innate/commit/44d02ed6987ded77747a2493bbb174c046acf703</url>
  <id>44d02ed6987ded77747a2493bbb174c046acf703</id>
  <committed-date>2009-09-21T17:02:09-07:00</committed-date>
  <authored-date>2009-09-21T17:02:09-07:00</authored-date>
  <message>Use Mutex instead of Thread::critical</message>
  <tree>97021dad4b34a0b689af668705f061d58151b7cb</tree>
  <committer>
    <name>Michael Fellinger</name>
    <email>m.fellinger@gmail.com</email>
  </committer>
</commit>
