Current setup is that NativeProcess.destroy is creating a local variable hasBeenClosed and checking if the StdioHandle has been closed yet. This is not ideal.
When destroy is called, the lock should be obtained and, within the lock, a local variable created hasBeenDestroyed before setting isDestroyed to true. Then if hasBeenDestroyed is false, Workers should be destroyed. This is so that the Workers are destroyed once and only once.
Current setup is that
NativeProcess.destroy
is creating a local variablehasBeenClosed
and checking if theStdioHandle
has been closed yet. This is not ideal.When
destroy
is called, the lock should be obtained and, within the lock, a local variable createdhasBeenDestroyed
before settingisDestroyed
to true. Then ifhasBeenDestroyed
is false,Worker
s should be destroyed. This is so that theWorker
s are destroyed once and only once.