Closed mebigfatguy closed 11 years ago
Out of old-school habits born before the java.util.concurrent
package became part of the JDK. :)
But you're right. The stopRunning()
method need not be synchronized.
Since the LinkedBlockingQueue
handles blocking, I didn't have to use the wait()
/notify()
methods. If I had used notify()
in the stopRunning()
then it would need to be synchronized.
In reality the cleanup()
and stopRunning()
methods are not likely to be called since it's more likely that storm will kill -9
the parent process.
Why is stopRunning synchronized, but run's use of stopRequested not? seems odd.