about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-04-23 22:07:27 -0700
committerEric Wong <normalperson@yhbt.net>2009-04-23 22:25:12 -0700
commit94fe8e18360245831d4cd97c2f006be8433365c7 (patch)
treeeb6f48eb37b0629a35619890115eb6122f3abe98
parent47ede272ebf82cff34afa1ad767e8a43bc2c6ae8 (diff)
downloadunicorn-94fe8e18360245831d4cd97c2f006be8433365c7.tar.gz
Avoid scaring the thread-safety-first crowd (as much :)
-rw-r--r--lib/unicorn.rb16
1 files 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