{"id":18443212,"url":"https://github.com/mkroening/one-shot-mutex","last_synced_at":"2025-04-14T20:15:56.674Z","repository":{"id":231303459,"uuid":"781423108","full_name":"mkroening/one-shot-mutex","owner":"mkroening","description":"One-shot locks that panic instead of (dead)locking on contention.","archived":false,"fork":false,"pushed_at":"2025-03-21T09:47:23.000Z","size":83,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T20:15:51.522Z","etag":null,"topics":["deadlock","mutex","no-std","rust","single-thread"],"latest_commit_sha":null,"homepage":"https://docs.rs/one-shot-mutex","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mkroening.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-03T10:59:18.000Z","updated_at":"2025-03-21T09:47:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"d518aa17-485d-496f-9e29-782d0df32986","html_url":"https://github.com/mkroening/one-shot-mutex","commit_stats":null,"previous_names":["mkroening/one-shot-mutex"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkroening%2Fone-shot-mutex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkroening%2Fone-shot-mutex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkroening%2Fone-shot-mutex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mkroening%2Fone-shot-mutex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mkroening","download_url":"https://codeload.github.com/mkroening/one-shot-mutex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248952356,"owners_count":21188427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deadlock","mutex","no-std","rust","single-thread"],"created_at":"2024-11-06T06:46:40.283Z","updated_at":"2025-04-14T20:15:56.668Z","avatar_url":"https://github.com/mkroening.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# one-shot-mutex\n\n[![Crates.io](https://img.shields.io/crates/v/one-shot-mutex)](https://crates.io/crates/one-shot-mutex)\n[![docs.rs](https://img.shields.io/docsrs/one-shot-mutex)](https://docs.rs/one-shot-mutex)\n[![CI](https://github.com/mkroening/one-shot-mutex/actions/workflows/ci.yml/badge.svg)](https://github.com/mkroening/one-shot-mutex/actions/workflows/ci.yml)\n\nOne-shot locks that panic instead of (dead)locking on contention.\n\nThese locks allow no contention and panic instead of blocking on `lock` if they are already locked.\nThis is useful in situations where contention would be a bug, such as in single-threaded programs that would deadlock on contention.\n\n```rust\nuse one_shot_mutex::sync::OneShotMutex;\n\nstatic X: OneShotMutex\u003ci32\u003e = OneShotMutex::new(42);\n\nlet x = X.lock();\n\n// This panics instead of deadlocking.\n// let x2 = X.lock();\n\n// Once we unlock the mutex, we can lock it again.\ndrop(x);\nlet x = X.lock();\n```\n\nFor API documentation, see the [docs].\n\n[docs]: https://docs.rs/one-shot-mutex\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0\n   ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license\n   ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkroening%2Fone-shot-mutex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkroening%2Fone-shot-mutex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkroening%2Fone-shot-mutex/lists"}