{"id":13809169,"url":"https://github.com/LK4D4/trylock","last_synced_at":"2025-05-14T05:33:24.853Z","repository":{"id":57486704,"uuid":"56612227","full_name":"LK4D4/trylock","owner":"LK4D4","description":"TryLock for Go","archived":false,"fork":false,"pushed_at":"2019-10-27T06:53:49.000Z","size":6,"stargazers_count":66,"open_issues_count":1,"forks_count":16,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-19T01:42:43.788Z","etag":null,"topics":["go","mutex","sync"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LK4D4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-19T16:10:24.000Z","updated_at":"2024-02-28T16:13:33.000Z","dependencies_parsed_at":"2022-09-02T00:02:42.043Z","dependency_job_id":null,"html_url":"https://github.com/LK4D4/trylock","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/LK4D4%2Ftrylock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LK4D4%2Ftrylock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LK4D4%2Ftrylock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LK4D4%2Ftrylock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LK4D4","download_url":"https://codeload.github.com/LK4D4/trylock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254077010,"owners_count":22010638,"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":["go","mutex","sync"],"created_at":"2024-08-04T01:02:04.100Z","updated_at":"2025-05-14T05:33:24.575Z","avatar_url":"https://github.com/LK4D4.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"trylock - TryLock implementation for Go\n=======================================\n\n[![Build Status](https://travis-ci.org/LK4D4/trylock.svg?branch=master)](https://travis-ci.org/LK4D4/trylock)\n[![GoDoc](https://godoc.org/github.com/LK4D4/trylock?status.svg)](https://godoc.org/github.com/LK4D4/trylock)\n\ntrylock uses unsafe, which is sorta \"unsafe\", but should work until `sync.Mutex`\nwill change its layout (I hope it never will).\n\n# Usage\n\n```go\ntype LockedStruct struct {\n\tmu trylock.Mutex\n}\n\nstorage := \u0026LockedStruct{}\n\nif storage.mu.TryLock() {\n\t// do something with storage\n} else {\n\t// return busy or use some logic for unavailable storage\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLK4D4%2Ftrylock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLK4D4%2Ftrylock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLK4D4%2Ftrylock/lists"}