Windows: Wait for all worker threads to exit
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 19 Dec 2012 14:31:06 +0000 (09:31 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 23 Dec 2012 04:16:39 +0000 (20:16 -0800)
commit1726aec2b2291c4b1e89e21fa0f5a27318671a6f
treefcc6d9f5999e3b38780701debb67344ed02d8aad
parent8a4094e9ffa5d0f96501817c8ffd3cc8dc7ec62b
Windows: Wait for all worker threads to exit

The signalling mechanism for waking and shutting down worker threads
relies upon a per-queue event.  Therefore it is not guaranteed that
the worker thread that AFSShutdown*Thread() is attempting to wait
for is in fact the thread that will be woken and exit.  Modify the
code to loop waking threads until the one that is being waited for
does in fact exit.

Subsequent calls to AFSShutdown*Thread() will bypass the wait if
the thread has already exited.

Change-Id: I4555df062ac5a6161b5c55f4598d1bd34e144a2b
Reviewed-on: http://gerrit.openafs.org/8783
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp