Reorganize the code a little, and add code to wait for all threads to finish processing pending messages before we exit.
Reorganize the code a little, and add code to wait for all threads to finish
processing pending messages before we exit.

Note that VSL_Dispatch() will read in log data as fast as it can, so when
working from a log file, varnishreplay will usually read in the entire file
into memory within the first few seconds.


git-svn-id: 2c9807fa3ff65b17195bd55dc8a6c4261e10127b@1623 d4fa192b-c00b-0410-8231-f00ffab90ce4

gauthier-delacroix/Varnish-Cache,chrismoulton/Varnish-Cache,drwilco/varnish-cache-drwilco,ambernetas/varnish-cache,gquintard/Varnish-Cache,franciscovg/Varnish-Cache,ajasty-cavium/Varnish-Cache,wikimedia/operations-debs-varnish,chrismoulton/Varnish-Cache,chrismoulton/Varnish-Cache,drwilco/varnish-cache-drwilco,ssm/pkg-varnish,zhoualbeart/Varnish-Cache,franciscovg/Varnish-Cache,gauthier-delacroix/Varnish-Cache,zhoualbeart/Varnish-Cache,alarky/varnish-cache-doc-ja,feld/Varnish-Cache,gauthier-delacroix/Varnish-Cache,alarky/varnish-cache-doc-ja,ambernetas/varnish-cache,wikimedia/operations-debs-varnish,ssm/pkg-varnish,1HLtd/Varnish-Cache,zhoualbeart/Varnish-Cache,feld/Varnish-Cache,mrhmouse/Varnish-Cache,alarky/varnish-cache-doc-ja,franciscovg/Varnish-Cache,mrhmouse/Varnish-Cache,ssm/pkg-varnish,ssm/pkg-varnish,gauthier-delacroix/Varnish-Cache,feld/Varnish-Cache,gauthier-delacroix/Varnish-Cache,zhoualbeart/Varnish-Cache,feld/Varnish-Cache,franciscovg/Varnish-Cache,varnish/Varnish-Cache,varnish/Varnish-Cache,ssm/pkg-varnish,chrismoulton/Varnish-Cache,gquintard/Varnish-Cache,gquintard/Varnish-Cache,varnish/Varnish-Cache,ajasty-cavium/Varnish-Cache,drwilco/varnish-cache-old,mrhmouse/Varnish-Cache,zhoualbeart/Varnish-Cache,mrhmouse/Varnish-Cache,alarky/varnish-cache-doc-ja,wikimedia/operations-debs-varnish,1HLtd/Varnish-Cache,wikimedia/operations-debs-varnish,drwilco/varnish-cache-old,1HLtd/Varnish-Cache,feld/Varnish-Cache,1HLtd/Varnish-Cache,ajasty-cavium/Varnish-Cache,varnish/Varnish-Cache,ajasty-cavium/Varnish-Cache,chrismoulton/Varnish-Cache,varnish/Varnish-Cache,drwilco/varnish-cache-drwilco,alarky/varnish-cache-doc-ja,wikimedia/operations-debs-varnish,mrhmouse/Varnish-Cache,gquintard/Varnish-Cache,franciscovg/Varnish-Cache,drwilco/varnish-cache-old,ambernetas/varnish-cache,ajasty-cavium/Varnish-Cache