Skip to content

Data-Race Issue with Oto on Mac Mini (Apple M2) #252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kuroko-shirai opened this issue Dec 9, 2024 · 1 comment
Closed

Data-Race Issue with Oto on Mac Mini (Apple M2) #252

kuroko-shirai opened this issue Dec 9, 2024 · 1 comment

Comments

@kuroko-shirai
Copy link

When running the following code with the -race flag on a Mac Mini (Apple M2), a data-race issue occurs:

otoCtx, readyChan, err := oto.NewContext(op)
if err != nil {
	panic("oto.NewContext failed: " + err.Error())
}

The issue is evident in the following screenshot:

telegram-cloud-photo-size-2-5384120476726584147-y

Fortunately, this issue can be easily resolved by modifying a single line in driver_darwin.go

ready = nil

Changing the line to:

<-ready

ensures that the readiness is awaited. I have tested this solution and it works correctly in my case.

@hajimehoshi
Copy link
Member

Thanks, fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants