<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -3,6 +3,45 @@ $:.unshift File.dirname(__FILE__)     # For use/testing when no gem is installed
 # rubygems
 require 'rubygems'
 
+begin
+  require 'fastthread'
+rescue RuntimeError =&gt; e
+  warn &quot;fastthread not loaded: #{ e.message }&quot;
+rescue LoadError
+ensure
+  require 'thread'
+end
+
+class Mutex
+  def lock
+    while (Thread.critical = true; @locked)
+      @waiting.unshift Thread.current
+      Thread.stop
+    end
+    @locked = true
+    Thread.critical = false
+    self
+  end
+  
+  def unlock
+    return unless @locked
+    Thread.critical = true
+    @locked = false
+    begin
+      t = @waiting.pop
+      t.wakeup if t
+    rescue ThreadError
+      retry
+    end
+    Thread.critical = false
+    begin
+      t.run if t
+    rescue ThreadError
+    end
+    self
+  end
+end
+
 # core
 require 'stringio'
 require 'logger'</diff>
      <filename>lib/god.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,7 @@ module God
     end
     
     self.directory = {}
-    self.mutex = Monitor.new
+    self.mutex = Mutex.new
     
     # Attach the condition to the hub and schedule/register it
     #   +condition+ is the Condition to attach
@@ -88,47 +88,49 @@ module God
           watch.mutex.synchronize do
             # ensure this condition is still active when we finally get the mutex
             if self.directory[condition] &amp;&amp; phase == watch.phase
-              # run the test
-              result = condition.test
-              
-              # log
-              messages = self.log(watch, metric, condition, result)
-              
-              # notify
-              if condition.notify &amp;&amp; self.trigger?(metric, result)
-                self.notify(condition, messages.last)
-              end
-              
-              # after-condition
-              condition.after
-              
-              # get the destination
-              dest = 
-              if result &amp;&amp; condition.transition
-                # condition override
-                condition.transition
-              else
-                # regular
-                metric.destination &amp;&amp; metric.destination[result]
-              end
-              
-              # transition or reschedule
-              if dest
-                # transition
-                begin
-                  # watch.move(dest)
-                  Timer.get.schedule(condition)
-                rescue EventRegistrationFailedError
-                  msg = watch.name + ' Event registration failed, moving back to previous state'
-                  applog(watch, :info, msg)
-                  
-                  dest = watch.state
-                  retry
-                end
-              else
-                # reschedule
-                Timer.get.schedule(condition)
-              end
+              # # run the test
+              # result = condition.test
+              # 
+              # # log
+              # messages = self.log(watch, metric, condition, result)
+              # 
+              # # notify
+              # if condition.notify &amp;&amp; self.trigger?(metric, result)
+              #   self.notify(condition, messages.last)
+              # end
+              # 
+              # # after-condition
+              # condition.after
+              # 
+              # # get the destination
+              # dest = 
+              # if result &amp;&amp; condition.transition
+              #   # condition override
+              #   condition.transition
+              # else
+              #   # regular
+              #   metric.destination &amp;&amp; metric.destination[result]
+              # end
+              # 
+              # # transition or reschedule
+              # if dest
+              #   # transition
+              #   begin
+              #     # watch.move(dest)
+              #     Timer.get.schedule(condition)
+              #   rescue EventRegistrationFailedError
+              #     msg = watch.name + ' Event registration failed, moving back to previous state'
+              #     applog(watch, :info, msg)
+              #     
+              #     dest = watch.state
+              #     retry
+              #   end
+              # else
+              #   # reschedule
+              #   Timer.get.schedule(condition)
+              # end
+              puts 'reschedule'
+              Timer.get.schedule(condition)
             end
           end
         rescue Exception =&gt; e</diff>
      <filename>lib/god/hub.rb</filename>
    </modified>
    <modified>
      <diff>@@ -55,17 +55,19 @@ module God
     #
     # Returns nothing
     def log(watch, level, text)
+      return
+      
       # initialize watch log if necessary
       self.logs[watch.name] ||= Timeline.new(God::LOG_BUFFER_SIZE_DEFAULT) if watch
       
       # push onto capture and timeline for the given watch
-      @templogio.truncate(0)
-      @templogio.rewind
-      @templog.send(level, text % [])
-      @mutex.synchronize do
-        @capture.puts(@templogio.string) if @capture
-        self.logs[watch.name] &lt;&lt; [Time.now, @templogio.string.dup] if watch
-      end
+      # @templogio.truncate(0)
+      # @templogio.rewind
+      # @templog.send(level, text % [])
+      # @mutex.synchronize do
+      #   @capture.puts(@templogio.string) if @capture
+      #   self.logs[watch.name] &lt;&lt; [Time.now, @templogio.string.dup] if watch
+      # end
       
       # send to regular logger
       self.send(level, text % [])</diff>
      <filename>lib/god/logger.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>425dfb0ed9219b7a4818351abb16aab9fe33d610</id>
    </parent>
  </parents>
  <author>
    <name>Tom Preston-Werner</name>
    <email>tom@mojombo.com</email>
  </author>
  <url>http://github.com/mojombo/god/commit/7d1665144a3a975c05f1f43902ddaf084e784dbe</url>
  <id>7d1665144a3a975c05f1f43902ddaf084e784dbe</id>
  <committed-date>2008-01-17T09:14:11-08:00</committed-date>
  <authored-date>2008-01-17T09:14:11-08:00</authored-date>
  <message>mutex fix?</message>
  <tree>24c69e8439634e81524299875975ca0c3691f074</tree>
  <committer>
    <name>Tom Preston-Werner</name>
    <email>tom@mojombo.com</email>
  </committer>
</commit>
