{"modulePath":"github.com/dockerstack/amazon-ecs-agent","version":"v1.2.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package sync\n\nPackage sync is an analogue to the stdlib sync package. It contains lowlevel synchonization primitives, but not quite as low level as 'sync' does\n\n## Types\n\n```go\ntype SequentialWaitGroup struct {\n\t// contains filtered or unexported fields\n}\n```\nA SequentialWaitGroup waits for a collection of goroutines to finish. Each goroutine may add itself to the waitgroup with 'Add', providing a sequence number. Each goroutine should then call 'Done' with its sequence number when finished. Elsewhere, 'Wait' can be used to wait for all groups at or below the provided sequence number to complete.\n\n```go\nfunc NewSequentialWaitGroup() *SequentialWaitGroup\n```\n\n```go\nfunc (s *SequentialWaitGroup) Add(sequence int64, delta int)\n```\nAdd adds the given delta to the waitgroup at the given sequence\n\n```go\nfunc (s *SequentialWaitGroup) Done(sequence int64)\n```\nDone decrements the waitgroup at the given sequence by one\n\n```go\nfunc (s *SequentialWaitGroup) Wait(sequence int64)\n```\nWait waits for all waitgroups at or below the given sequence to complete. Please note that this is \\*INCLUSIVE\\* of the sequence\n\n","path":"github.com/dockerstack/amazon-ecs-agent/agent/utils/sync","name":"sync","synopsis":"Package sync is an analogue to the stdlib sync package.","isRedistributable":true}
