mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-17 16:50:31 +00:00
Use thread OS lock only with GL cores
This commit is contained in:
parent
8bfe576032
commit
168bad0450
1 changed files with 7 additions and 3 deletions
|
|
@ -62,6 +62,7 @@ type Frontend struct {
|
|||
onVideo func(app.Video)
|
||||
storage Storage
|
||||
scale float64
|
||||
isGL bool
|
||||
th int // draw threads
|
||||
vw, vh int // out frame size
|
||||
|
||||
|
|
@ -186,6 +187,7 @@ func (f *Frontend) LoadCore(emu string) {
|
|||
}
|
||||
f.storage.SetNonBlocking(conf.NonBlockingSave)
|
||||
f.scale = scale
|
||||
f.isGL = conf.IsGlAllowed
|
||||
f.nano.CoreLoad(meta)
|
||||
f.mu.Unlock()
|
||||
}
|
||||
|
|
@ -268,9 +270,11 @@ func (f *Frontend) Start() {
|
|||
return
|
||||
}
|
||||
|
||||
// don't jump between threads
|
||||
runtime.LockOSThread()
|
||||
defer runtime.UnlockOSThread()
|
||||
if f.isGL {
|
||||
// don't jump between threads
|
||||
runtime.LockOSThread()
|
||||
defer runtime.UnlockOSThread()
|
||||
}
|
||||
|
||||
f.mui.Lock()
|
||||
f.done = make(chan struct{})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue