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

Mutex and other resources are not destroyed #18

Open
Matthias247 opened this issue Nov 2, 2021 · 0 comments
Open

Mutex and other resources are not destroyed #18

Matthias247 opened this issue Nov 2, 2021 · 0 comments

Comments

@Matthias247
Copy link

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.

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

1 participant