mirror of https://github.com/PCSX2/pcsx2.git
ac78688a32
In the previous code, the threads were created and destroyed in the base class constructor and destructor, so the threads could potentially be active while the object is in a partially constructed or destroyed state. The thread however, relies on a virtual function to process the queue items, and the vtable might not be in the desired state when the object is partially constructed or destroyed. This probably only matters during object destruction - no items are in the queue during object construction so the virtual function won't be called, but items may still be queued up when the destructor is called, so the virtual function can be called. It wasn't an issue because all uses of the thread explicitly waited for the queues to be empty before invoking the destructor. Adjust the constructor to take a std::function parameter, which the thread will use instead to process queue items, and avoid inheriting from the GSJobQueue class. This will also eliminate the need to explicitly wait for all jobs to finish (unless there are other external factors, of course), which would probably make future code safer. |
||
---|---|---|
.. | ||
CDVDiso | ||
CDVDisoEFP | ||
CDVDlinuz | ||
CDVDnull | ||
CDVDolio | ||
CDVDpeops | ||
FWnull | ||
GSdx | ||
GSdx_legacy | ||
GSnull | ||
LilyPad | ||
PadNull | ||
PeopsSPU2 | ||
SPU2null | ||
SSSPSXPAD | ||
USBnull | ||
USBqemu | ||
cdvdGigaherz/src | ||
dev9ghzdrk | ||
dev9null | ||
onepad | ||
spu2-x | ||
xpad | ||
zerogs | ||
zerospu2 | ||
zzogl-pg/opengl | ||
CMakeLists.txt |