{"id":17099832,"url":"https://github.com/cppcoffee/sharelock-rs","last_synced_at":"2025-07-30T09:42:09.890Z","repository":{"id":135560191,"uuid":"368748707","full_name":"cppcoffee/sharelock-rs","owner":"cppcoffee","description":"A spin reader-writer lock.","archived":false,"fork":false,"pushed_at":"2021-05-19T15:26:06.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-29T00:46:57.282Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cppcoffee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-05-19T04:58:29.000Z","updated_at":"2021-05-19T15:26:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"2eb1787e-5bb4-4191-960c-427ec1889c9f","html_url":"https://github.com/cppcoffee/sharelock-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppcoffee%2Fsharelock-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppcoffee%2Fsharelock-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppcoffee%2Fsharelock-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cppcoffee%2Fsharelock-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cppcoffee","download_url":"https://codeload.github.com/cppcoffee/sharelock-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245147565,"owners_count":20568531,"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":[],"created_at":"2024-10-14T15:11:32.597Z","updated_at":"2025-03-23T18:27:21.646Z","avatar_url":"https://github.com/cppcoffee.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sharedlock-rs\n\n## Introduce\n\nShareLock is a spin read/write lock library implemented using rust.\n\nThe RAII guards returned from the locking methods implement Deref (and DerefMut for the write methods) to allow access to the content of the lock.\n\n\n## Examples\n\n```rust\nuse sharedlock_rs::SharedLock;\n\nlet lock = SharedLock::new(5);\n\n{\n    let r1 = lock.read().unwrap();\n    let r2 = lock.read().unwrap();\n    assert_eq!(*r1, 5);\n    assert_eq!(*r2, 5);\n}\n\n{\n    let mut w = lock.write().unwrap();\n    *w += 1;\n    assert_eq!(*w, 6);\n}\n```\n\n\n## Reference\n\n[https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock](https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcppcoffee%2Fsharelock-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcppcoffee%2Fsharelock-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcppcoffee%2Fsharelock-rs/lists"}