Minor tweaks so the code now works with only 1 thread successfully
This commit is contained in:
parent
70a0190a32
commit
5b00ea2b3d
|
@ -2804,10 +2804,8 @@ bool MainFrame::InitMore(void)
|
|||
getcbb("VSync", gopts.vsync);
|
||||
// FIXME: make cb disabled when not GL or d3d
|
||||
int mthr = wxThread::GetCPUCount();
|
||||
if(mthr > 8)
|
||||
mthr = 8;
|
||||
if(mthr < 0)
|
||||
mthr = 2;
|
||||
if(mthr < 1 )
|
||||
mthr = 1;
|
||||
cb=SafeXRCCTRL<wxCheckBox>(d, "Multithread");
|
||||
cb->SetValidator(wxBoolIntValidator(&gopts.max_threads, mthr));
|
||||
if(mthr <= 1)
|
||||
|
|
|
@ -1083,7 +1083,7 @@ DrawingPanel::DrawingPanel(int _width, int _height) :
|
|||
|
||||
// Create and start up new threads
|
||||
nthreads = gopts.max_threads;
|
||||
if(nthreads > 1) {
|
||||
if(nthreads) {
|
||||
threads = new FilterThread[nthreads];
|
||||
for(int i = 0; i < nthreads; i++) {
|
||||
threads[i].threadno = i;
|
||||
|
@ -1133,7 +1133,7 @@ void DrawingPanel::DrawArea(u8 **data)
|
|||
int horiz_bytes_out = width * bytes_per_pixel * scale;
|
||||
|
||||
// First, apply filters, if applicable, in parallel, if enabled
|
||||
if(myFilter->exists() || iFilter->exists() )
|
||||
if(nthreads)
|
||||
{
|
||||
for(int i = 0; i < nthreads; i++) {
|
||||
threads[i].lock.Lock();
|
||||
|
|
Loading…
Reference in New Issue