about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2014-01-01 10:18:13 +0000
committerEric Wong <e@80x24.org>2014-01-01 10:18:13 +0000
commitf4acfcc66757ddda1690ff598ee17e7b3f5f8d46 (patch)
tree53e2af8a13cb0a1a2987ee8afee04f68a2b51b7a
parent5535a4e78637c35081d42bf949e3995997ceefcb (diff)
downloadyahns-f4acfcc66757ddda1690ff598ee17e7b3f5f8d46.tar.gz
Unicorn::HttpResponse#httpdate is currently not thread-safe without GVL.
-rw-r--r--lib/yahns/http_response.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/yahns/http_response.rb b/lib/yahns/http_response.rb
index 05923c9..65ecdff 100644
--- a/lib/yahns/http_response.rb
+++ b/lib/yahns/http_response.rb
@@ -15,6 +15,13 @@ require_relative 'wbuf_str'
 module Yahns::HttpResponse # :nodoc:
   include Unicorn::HttpResponse
 
+  if defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
+    MTX = Mutex.new
+    def httpdate
+      MTX.synchronize { super }
+    end
+  end
+
   # avoid GC overhead for frequently used-strings:
   CONN_KA = "Connection: keep-alive\r\n\r\n"
   CONN_CLOSE = "Connection: close\r\n\r\n"