{"id":16643436,"url":"https://github.com/sonots/reentrant_flock","last_synced_at":"2025-10-30T12:30:22.315Z","repository":{"id":56891584,"uuid":"102381192","full_name":"sonots/reentrant_flock","owner":"sonots","description":"A reentrant/recursive flock for ruby","archived":false,"fork":false,"pushed_at":"2017-11-24T16:16:44.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-06T19:02:22.670Z","etag":null,"topics":["flock","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/sonots.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-09-04T16:29:21.000Z","updated_at":"2017-09-06T23:58:51.000Z","dependencies_parsed_at":"2022-08-21T00:20:40.331Z","dependency_job_id":null,"html_url":"https://github.com/sonots/reentrant_flock","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonots%2Freentrant_flock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonots%2Freentrant_flock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonots%2Freentrant_flock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonots%2Freentrant_flock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sonots","download_url":"https://codeload.github.com/sonots/reentrant_flock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238961168,"owners_count":19559432,"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":["flock","ruby"],"created_at":"2024-10-12T08:08:32.298Z","updated_at":"2025-10-30T12:30:16.978Z","avatar_url":"https://github.com/sonots.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ReentrantFlock\n\nA reentrant/recursive flock.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'reentrant_flock'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install reentrant_flock\n\n## Usage\n\n```ruby\nrequire 'reentrant_flock'\n\nFile.open('/tmp/lock', File::RDWR | File::CREAT) do |fp|\n  ReentrantFlock.synchronize(fp, File::LOCK_EX) do\n    ReentrantFlock.synchronize(fp, File::LOCK_EX) do\n      # Not blocked by myself\n    end\n  end\nend\n```\n\n```ruby\nrequire 'reentrant_flock'\n\ndef with_rlock(\u0026block)\n  File.open('/tmp/lock', File::RDWR | File::CREAT) do |fp|\n    ReentrantFlock.synchronize(fp, File::LOCK_EX, \u0026block)\n  end\nend\n\nwith_rlock do\n  with_rlock do\n    # Not blocked by myself\n  end\nend\n```\n\n`ReentrantFlock.synchronize` would raise `ReentrantFlock::AlreadyLocked` if `File::LOCK_NB` is given and already locked by somebody else.\n\nSee [File#flock](https://ruby-doc.org/core-2.2.0/File.html#method-i-flock) for flags.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/sonots/reentrant_flock.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonots%2Freentrant_flock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonots%2Freentrant_flock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonots%2Freentrant_flock/lists"}