Skip to content

Instantly share code, notes, and snippets.

@shixzie
Created July 29, 2017 04:08
Show Gist options
  • Select an option

  • Save shixzie/c4922f6c881077cef4bd54455316165d to your computer and use it in GitHub Desktop.

Select an option

Save shixzie/c4922f6c881077cef4bd54455316165d to your computer and use it in GitHub Desktop.

Revisions

  1. shixzie created this gist Jul 29, 2017.
    5 changes: 5 additions & 0 deletions sync_atomic_2.go
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    func Add<T>(addr *T, delta T) (new T)
    func CompareAndSwap<T>(addr *T, old, new T) (swapped bool)
    func Load<T>(addr *T) (val T)
    func Store<T>(addr *T, val T)
    func Swap<T>(addr *T, new T) (old T)