Hacker News new | ask | show | jobs
by Locke1689 3991 days ago
Two things:

1) Unless you've explicitly checked that Go's memory model prevents read/write moves to allow double-checked locking, don't do it.

2) The pattern is usually a CAS after the check.