François SIMOND
Sun, 28 May 2006 10:39:53 -0700
Here is a rudimentary patch against mongrel-0.3.12.4, that basically works ! I could not imagine that it would be so easy :)
-- François SIMOND
diff -urN mongrel-0.3.12.4/lib/mongrel/rails.rb
mongrel-0.3.12.4-rails-allow_concurrency/lib/mongrel/rails.rb
--- mongrel-0.3.12.4/lib/mongrel/rails.rb 2006-05-28 19:05:10.000000000
+0200
+++ mongrel-0.3.12.4-rails-allow_concurrency/lib/mongrel/rails.rb
2006-05-28 19:28:03.000000000 +0200
@@ -61,10 +61,10 @@
cgi = Mongrel::CGIWrapper.new(request, response)
cgi.handler = self
- @guard.synchronize do
- # Rails is not thread safe so must be run entirely within
synchronize
+ @guard.lock unless ActionController::Base.allow_concurrency
+ # Rails must be entirely runned within synchronisation if
choosen in the config
Dispatcher.dispatch(cgi,
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS, response.body)
- end
+ @guard.unlock
# This finalizes the output using the proper HttpResponse way
cgi.out {""}
_______________________________________________ Mongrel-users mailing list Mongrel-users@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users