devvga: better way to prevent blank hwaccel race
don't hold drawlock duing vga enable and disable, but just zero the function pointers under drawlock *before* disabling the vga device. holding the drawlock while calling out into enable and disable is not a good idea. with vgavesa, this might deadlock when userspace realemu tries to print in a rio window with vgavesa.
This commit is contained in:
parent
9aec87c46c
commit
6cb93914f2
1 changed files with 4 additions and 9 deletions
|
@ -309,23 +309,18 @@ vgactl(Cmdbuf *cb)
|
|||
for(i = 0; vgadev[i]; i++){
|
||||
if(strcmp(cb->f[1], vgadev[i]->name))
|
||||
continue;
|
||||
qlock(&drawlock);
|
||||
if(waserror()){
|
||||
qunlock(&drawlock);
|
||||
nexterror();
|
||||
}
|
||||
if(scr->dev){
|
||||
if(scr->dev->disable)
|
||||
scr->dev->disable(scr);
|
||||
qlock(&drawlock);
|
||||
scr->fill = nil;
|
||||
scr->scroll = nil;
|
||||
scr->blank = nil;
|
||||
qunlock(&drawlock);
|
||||
if(scr->dev->disable)
|
||||
scr->dev->disable(scr);
|
||||
}
|
||||
scr->dev = vgadev[i];
|
||||
if(scr->dev->enable)
|
||||
scr->dev->enable(scr);
|
||||
qunlock(&drawlock);
|
||||
poperror();
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue