dCache/dcache — pull request #467 by paulmillar (2014-03-19 10:57:06+00:00)
Title: srm: fix race condition if stop is called too soon after start

The WorkSupplyService fetches information that is protected by
the Scheduler monitor. If the stop method is called while the
WorkSupplyService is not resting then the thread calling stop
enters the Scheduler monitor and waits for the WorkSupplyService
service to end, resulting in a deadlock.

This patch fixes this by moving the WorkSupplyService activation
and deactivation so it happens outside the Scheduler monitor.

Target: master
Acked-by: Dmitry Litvintsev
Patch: http://rb.dcache.org/r/6750/
Request: 2.8