From 94fe8e18360245831d4cd97c2f006be8433365c7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 23 Apr 2009 22:07:27 -0700 Subject: Describe the global constants we use. Avoid scaring the thread-safety-first crowd (as much :) --- lib/unicorn.rb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/unicorn.rb b/lib/unicorn.rb index cbbbe32..d2a18fb 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -25,11 +25,23 @@ module Unicorn attr_reader :logger include ::Unicorn::SocketHelper - IO_PURGATORY = [] # prevents IO objects in here from being GC-ed - SIG_QUEUE = [] + # prevents IO objects in here from being GC-ed + IO_PURGATORY = [] + + # all bound listener sockets LISTENERS = [] + + # This hash maps PIDs to Workers WORKERS = {} + + # See: http://cr.yp.to/docs/selfpipe.html SELF_PIPE = [] + + # signal queue used for self-piping + SIG_QUEUE = [] + + # We populate this at startup so we can figure out how to reexecute + # and upgrade the currently running instance of Unicorn START_CTX = { :argv => ARGV.map { |arg| arg.dup }, # don't rely on Dir.pwd here since it's not symlink-aware, and -- cgit v1.2.3-24-ge0c7