Skip to content
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

fix: do not lock api pointer #160

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Conversation

decahedron1
Copy link
Member

The previous api() behavior was a remnant from nbigaouette/onnxruntime-rs. I am not sure why we need a Mutex here, or why api() unsafely dereferences the pointer, or why we need to get_mut() on the AtomicPtr. Refactoring the code to forego a Mutex and do a regular atomic load on the pointer fixes #157 (more on Discord), in which a SIGSEGV was encountered when multiple sessions were being created simultaneously from different threads.

@decahedron1 decahedron1 merged commit 04df44d into main Feb 15, 2024
5 of 6 checks passed
@decahedron1 decahedron1 deleted the alternative-synchronization branch February 15, 2024 05:20
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

Successfully merging this pull request may close these issues.

EXC_BAD_ACCESS
1 participant