Hi,
maybe the stopping should be done in a similar way as pausing. Instead of directly changing the internal state the stopSnapshot will just set a flag that snapshot is going to be stopped.
The snapshotRunning is IMHO run from only one thred. This method would check also the flag, and reset the internal state as well. It would also need to be renamed so it is clear that it is not only checking the state but doing changes too.
The other option is to modify readChunk methodto check if stopping flag is set. If it is then just set the state and return.
WDYT?
J.