{"id":13413040,"url":"https://github.com/marusama/cyclicbarrier","last_synced_at":"2026-01-12T10:21:13.376Z","repository":{"id":57483327,"uuid":"117086481","full_name":"marusama/cyclicbarrier","owner":"marusama","description":"CyclicBarrier golang implementation","archived":false,"fork":false,"pushed_at":"2020-06-30T10:11:31.000Z","size":16,"stargazers_count":140,"open_issues_count":0,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-07-31T20:51:52.703Z","etag":null,"topics":["barrier","cyclic","cyclicbarrier","cyclicbarrier-golang","go","golang"],"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/marusama.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":"2018-01-11T10:38:46.000Z","updated_at":"2024-07-02T02:04:18.000Z","dependencies_parsed_at":"2022-08-27T23:21:48.384Z","dependency_job_id":null,"html_url":"https://github.com/marusama/cyclicbarrier","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/marusama/cyclicbarrier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marusama%2Fcyclicbarrier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marusama%2Fcyclicbarrier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marusama%2Fcyclicbarrier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marusama%2Fcyclicbarrier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marusama","download_url":"https://codeload.github.com/marusama/cyclicbarrier/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marusama%2Fcyclicbarrier/sbom","scorecard":{"id":622234,"data":{"date":"2025-08-11","repo":{"name":"github.com/marusama/cyclicbarrier","commit":"1717099fdc00c6ca42385964044cffd5272fa0ca"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T05:27:37.602Z","repository_id":57483327,"created_at":"2025-08-21T05:27:37.602Z","updated_at":"2025-08-21T05:27:37.602Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338174,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["barrier","cyclic","cyclicbarrier","cyclicbarrier-golang","go","golang"],"created_at":"2024-07-30T20:01:32.700Z","updated_at":"2026-01-12T10:21:13.330Z","avatar_url":"https://github.com/marusama.png","language":"Go","funding_links":[],"categories":["Misc","Goroutines","Goroutines `goroutines的管理和使用`","Relational Databases"],"sub_categories":["SQL 查询语句构建库","Advanced Console UIs","Search and Analytic Databases","检索及分析资料库"],"readme":"cyclicbarrier\n=============\n[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/avelino/awesome-go#goroutines)\n[![Build Status](https://travis-ci.org/marusama/cyclicbarrier.svg?branch=master)](https://travis-ci.org/marusama/cyclicbarrier)\n[![Go Report Card](https://goreportcard.com/badge/github.com/marusama/cyclicbarrier)](https://goreportcard.com/report/github.com/marusama/cyclicbarrier)\n[![Coverage Status](https://coveralls.io/repos/github/marusama/cyclicbarrier/badge.svg?branch=master)](https://coveralls.io/github/marusama/cyclicbarrier?branch=master)\n[![GoDoc](https://godoc.org/github.com/marusama/cyclicbarrier?status.svg)](https://godoc.org/github.com/marusama/cyclicbarrier)\n[![License](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](LICENSE)\n\nCyclicBarrier is a synchronizer that allows a set of goroutines to wait for each other to reach a common execution point, also called a barrier.\n\nInspired by Java CyclicBarrier https://docs.oracle.com/javase/9/docs/api/java/util/concurrent/CyclicBarrier.html and C# Barrier https://msdn.microsoft.com/en-us/library/system.threading.barrier(v=vs.110).aspx\n\n### Usage\nInitiate\n```go\nimport \"github.com/marusama/cyclicbarrier\"\n...\nb1 := cyclicbarrier.New(10) // new cyclic barrier with parties = 10\n...\nb2 := cyclicbarrier.NewWithAction(10, func() error { return nil }) // new cyclic barrier with parties = 10 and with defined barrier action\n```\nAwait\n```go\nb.Await(ctx)    // await other parties\n```\nReset\n```go\nb.Reset()       // reset the barrier\n```\n\n### Simple example\n```go\n// create a barrier for 10 parties with an action that increments counter\n// this action will be called each time when all goroutines reach the barrier\ncnt := 0\nb := cyclicbarrier.NewWithAction(10, func() error {\n    cnt++\n    return nil\n})\n\nwg := sync.WaitGroup{}\nfor i := 0; i \u003c 10; i++ {           // create 10 goroutines (the same count as barrier parties)\n    wg.Add(1)\n    go func() {\n        for j := 0; j \u003c 5; j++ {\n            \n            // do some hard work 5 times\n            time.Sleep(100 * time.Millisecond)                     \n            \n            err := b.Await(context.TODO()) // ..and wait for other parties on the barrier.\n                                           // Last arrived goroutine will do the barrier action\n                                           // and then pass all other goroutines to the next round\n            if err != nil {\n                panic(err)\n            }\n        }\n        wg.Done()\n    }()\n}\n\nwg.Wait()\nfmt.Println(cnt)                    // cnt = 5, it means that the barrier was passed 5 times\n```\n\nFor more documentation see https://godoc.org/github.com/marusama/cyclicbarrier\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarusama%2Fcyclicbarrier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarusama%2Fcyclicbarrier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarusama%2Fcyclicbarrier/lists"}