Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Mutex and other resources are not destroyed

Open
#18 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
rust

Research direction

Start by reading the Mutex implementation around Mutex::new and Mutex::from_existing, then inspect how the other primitives manage ownership. Check where pthread_mutex_destroy is absent and determine which destruction or shared-reference behavior the project can support; done requires an agreed design for safely releasing these resources.

Written by the indexing model from the issue text.

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.

Dominant language
Rust
Stars
66
Forks
20
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from elast0ny/raw_sync-rs

All issues in elast0ny/raw_sync-rs

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.