Add another workaround for g0 stack in Go 1.22.5 (#460)

This commit is contained in:
sergystepanov 2024-07-05 22:56:28 +03:00 committed by GitHub
parent ca64bd127e
commit ba45936d77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -304,9 +304,11 @@ func (n *Nanoarch) LoadGame(path string) error {
n.log.Debug().Msgf("Set buffer: %v", byteCountBinary(int64(bufS)))
if n.LibCo {
C.same_thread(C.init_video_cgo)
C.same_thread(unsafe.Pointer(Nan0.Video.hw.context_reset))
} else {
runtime.LockOSThread()
initVideo()
C.bridge_context_reset(Nan0.Video.hw.context_reset)
runtime.UnlockOSThread()
}
}
@ -853,7 +855,6 @@ func initVideo() {
}
Nan0.sdlCtx = sdl
C.bridge_context_reset(Nan0.Video.hw.context_reset)
if Nan0.log.GetLevel() < logger.InfoLevel {
printOpenGLDriverInfo()
}