Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer (GitLab) <jacob@gitlab.com>2018-04-06 11:04:25 +0300
committerZeger-Jan van de Weg <zegerjan@gitlab.com>2018-04-06 11:04:25 +0300
commit4dadabad50b7821ee625166b8824b69b25a3221f (patch)
tree537cd5cae60ee948a73178f47cc2ff39dd1e092e /STYLE.md
parent5afd6a821d5530c4fcd244fec0c8b534f2387756 (diff)
Don't use sync/atomic
Diffstat (limited to 'STYLE.md')
-rw-r--r--STYLE.md13
1 files changed, 12 insertions, 1 deletions
diff --git a/STYLE.md b/STYLE.md
index 3a6ae2bad..d72775073 100644
--- a/STYLE.md
+++ b/STYLE.md
@@ -107,4 +107,15 @@ instead of:
func (server) GetBlob(_ *pb.GetBlobRequest, _ pb.BlobService_GetBlobServer) error {
return helper.Unimplemented
}
-``` \ No newline at end of file
+```
+
+## Concurrency
+
+The [documentation of "sync/atomic"](https://golang.org/pkg/sync/atomic/) says:
+
+> These functions require great care to be used correctly. Except for
+special, low-level applications, synchronization is better done with
+channels or the facilities of the sync package.
+
+Gitaly is not a low-level application so we should avoid "sync/atomic".
+We use channels and [package "sync"](https://golang.org/pkg/sync/).