diff options
author | evanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9> | 2007-10-26 09:04:18 +0000 |
---|---|---|
committer | evanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9> | 2007-10-26 09:04:18 +0000 |
commit | 1b1d758124a0f30e0a331716e6684973ca2bc94b (patch) | |
tree | a20171160b721a59cb1cce210260b4f279bb3a51 /lib | |
parent | e08dcef63f437ad03117752e00618da9546038ae (diff) | |
download | unicorn-1b1d758124a0f30e0a331716e6684973ca2bc94b.tar.gz |
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@765 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mongrel.rb | 24 | ||||
-rw-r--r-- | lib/mutex_fix.rb | 34 |
2 files changed, 13 insertions, 45 deletions
diff --git a/lib/mongrel.rb b/lib/mongrel.rb index d5ac6f8..4c02a88 100644 --- a/lib/mongrel.rb +++ b/lib/mongrel.rb @@ -1,12 +1,12 @@ -# Copyright (c) 2005 Zed A. Shaw -# You can redistribute it and/or modify it under the same terms as Ruby. -# -# Additional work donated by contributors. See http://mongrel.rubyforge.org/attributions.html -# for more information. require 'socket' require 'http11' require 'tempfile' +require 'yaml' +require 'time' +require 'etc' +require 'uri' +require 'stringio' begin require 'fastthread' @@ -19,17 +19,11 @@ end require 'cgi_multipart_eof_fix' -require 'stringio' require 'mongrel/cgi' require 'mongrel/handlers' require 'mongrel/command' require 'mongrel/tcphack' -require 'yaml' require 'mongrel/configurator' -require 'time' -require 'etc' -require 'uri' - # Mongrel module containing all of the classes (include C extensions) for running # a Mongrel web server. It contains a minimalist HTTP server with just enough @@ -871,3 +865,11 @@ module Mongrel end end + +# Load experimental gem, if present. We put it here so it can override anything +# in regular Mongrel. + +begin + require 'mongrel_experimental', '=1.1' +rescue LoadError +end diff --git a/lib/mutex_fix.rb b/lib/mutex_fix.rb deleted file mode 100644 index a844401..0000000 --- a/lib/mutex_fix.rb +++ /dev/null @@ -1,34 +0,0 @@ -require 'thread' - -# monkey patch Mutex so it does not leak memory. -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
\ No newline at end of file |