diff options
author | Eric Wong <e@80x24.org> | 2014-01-01 10:18:13 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2014-01-01 10:18:13 +0000 |
commit | f4acfcc66757ddda1690ff598ee17e7b3f5f8d46 (patch) | |
tree | 53e2af8a13cb0a1a2987ee8afee04f68a2b51b7a | |
parent | 5535a4e78637c35081d42bf949e3995997ceefcb (diff) | |
download | yahns-f4acfcc66757ddda1690ff598ee17e7b3f5f8d46.tar.gz |
Unicorn::HttpResponse#httpdate is currently not thread-safe without GVL.
-rw-r--r-- | lib/yahns/http_response.rb | 7 |
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" |