<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,6 @@
 == 1.0.0 The Big release
- * Add --force (-f) option to force stopping of a daemonized server, fixes [#72 state:resolved]
+ * Add --no-epoll option to disable epoll usage on Linux [#61 state:resolved]
+ * Add --force (-f) option to force stopping of a daemonized server [#72 state:resolved]
  * Update halycon adapter loader [mtodd]
 
 == 0.8.2 Double Margarita release</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -30,6 +30,9 @@ module Thin
       # Number of persistent connections currently opened
       attr_accessor :persistent_connection_count
       
+      # Disable the use of epoll under Linux
+      attr_accessor :no_epoll
+      
       def initialize
         @connections                    = []
         @timeout                        = Server::DEFAULT_TIMEOUT
@@ -72,7 +75,7 @@ module Thin
       # so you can do crazy stuff that require godlike powers here.
       def config
         # See http://rubyeventmachine.com/pub/rdoc/files/EPOLL.html
-        EventMachine.epoll
+        EventMachine.epoll unless @no_epoll
         
         # Set the maximum number of socket descriptors that the server may open.
         # The process needs to have required privilege to set it higher the 1024 on</diff>
      <filename>lib/thin/backends/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -49,6 +49,7 @@ module Thin
         server.maximum_connections            = @options[:max_conns]
         server.maximum_persistent_connections = @options[:max_persistent_conns]
         server.threaded                       = @options[:threaded]
+        server.no_epoll                       = @options[:no_epoll]
 
         # Detach the process, after this line the current process returns
         server.daemonize if @options[:daemonize]</diff>
      <filename>lib/thin/controllers/controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -111,6 +111,7 @@ module Thin
                                        &quot;(default: #{@options[:max_persistent_conns]})&quot;) { |num| @options[:max_persistent_conns] = num.to_i }
         opts.on(      &quot;--threaded&quot;, &quot;Call the Rack application in threads &quot; +
                                     &quot;[experimental]&quot;)                                   { @options[:threaded] = true }
+        opts.on(      &quot;--no-epoll&quot;, &quot;Disable the use of epoll&quot;)                         { @options[:no_epoll] = true } if Thin.linux?
         
         opts.separator &quot;&quot;
         opts.separator &quot;Common options:&quot;</diff>
      <filename>lib/thin/runner.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,17 @@ describe Backends::TcpServer do
     @backend = Backends::TcpServer.new('0.0.0.0', 3333)
   end
   
+  it &quot;should not use epoll&quot; do
+    @backend.no_epoll = true
+    EventMachine.should_not_receive(:epoll)
+    @backend.config
+  end
+  
+  it &quot;should use epoll&quot; do
+    EventMachine.should_receive(:epoll)
+    @backend.config
+  end
+  
   it &quot;should connect&quot; do
     EventMachine.run do
       @backend.connect</diff>
      <filename>spec/backends/tcp_server_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>729b76ae2391a197e14d1bb8ec2d40f82a47b1a4</id>
    </parent>
  </parents>
  <author>
    <name>macournoyer</name>
    <email>macournoyer@gmail.com</email>
  </author>
  <url>http://github.com/macournoyer/thin/commit/37fbf1d50876315d94865e6ad44c4ac4d9840599</url>
  <id>37fbf1d50876315d94865e6ad44c4ac4d9840599</id>
  <committed-date>2008-07-13T20:43:16-07:00</committed-date>
  <authored-date>2008-07-13T20:43:16-07:00</authored-date>
  <message>Add --no-epoll option to disable epoll usage on Linux [#61 state:resolved]</message>
  <tree>4b5003107f0a76cf5746a043e1bac5a0574b3916</tree>
  <committer>
    <name>macournoyer</name>
    <email>macournoyer@gmail.com</email>
  </committer>
</commit>
