ENH: Rename AsynchronousVolumeReader to VolumeReaderJobFactory.
ENH: Convert VolumeReaderJobFactory into a singleton to make it clear that it holds global state.
ENH: Make VolumeReaderJobFactory keep and return shared pointers to VolumeReaderJob directly, in order to avoid several explicit casts from ThreadWeaver::JobPointer.
COMP: Move is32BitWindows() to an unnamed namespace.
ENH: Implement a destructor for VolumeReaderJobFactory that cancels all pending jobs and waits for them to finish.
ENH: VolumeReaderJob stores the volume identifier to be able to use it even if the volume is deleted.
ENH: Use the volume identifier to unmark a volume as loading in the volume reader job factory.
BUG: Don't remove the queue policy from the job when cancelling it, as this causes some times that volumes that have the same restriction can't load.
BUG: Ensure that all volume reader jobs are deleted before the factory. To do this we need to ensure that all shared pointers to any job are deleted. This is achieved in three steps:
1. Clear the list of volumes that are loading.
2. Dequeue pending jobs, and abort running jobs and wait for them to finish (this was done in a previous commit).
3. Force the event loop to run to clear the queue of 'done(job)' signals.
BUG: requestAbort() may be called before having a pixel data reader.
ENH: Keep a boolean to know if abort has been requested before creating the pixel data reader and use it to avoid reading if it's true.
ENH: Restore a connection that was wrongly removed during the port to the new version of ThreadWeaver. This connection is needed to delete a volume that is being loaded by a job. With this implementation sometimes a volume can still remain undeleted causing a small memory leak, but this should be improved in a future change.