elast0ny / elast0ny/raw_sync-rs
Mutex and other resources are not destroyed
- Dominant language
- Rust
- Stars
- 66
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
While looking at the Mutex implementation, I noticed that there is never a call to `pthread_mutex_destroy`, and the same applies also to other primitives. This "might" lead to leaks in the application. Might, because on some platforms that isn't necessary.
Now the current `Mutex::new` and `Mutex:: from_existing` results probably can't do that automatic freeing, since they are not sure whether something else still uses them. There might need to be either an `unsafe` destroy method for it.
Alternatively, there can be refcount stored in shared memory next to the mutex, and dropping any of those objects decreases it.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.