cloud-game/pkg/thread/mainthread_darwin_test.go
sergystepanov e53cf45fa7
Main thread lock refactoring (#367)
Use slim main thread locking function for macOS instead of a lib.
2022-06-12 13:39:23 +03:00

16 lines
219 B
Go

package thread
import "testing"
func init() {
runtime.LockOSThread()
}
func TestMainThread(t *testing.T) {
value := 0
fn := func() { value = 1 }
Main(fn)
if value != 1 {
t.Errorf("wrong value %v", value)
}
}