sync.go 489 B

1234567891011121314151617
  1. // Copyright 2021 The Libc Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package libc // import "modernc.org/libc"
  5. import (
  6. "sync/atomic"
  7. )
  8. var __sync_synchronize_dummy int32
  9. // __sync_synchronize();
  10. func X__sync_synchronize(t *TLS) {
  11. // Attempt to implement a full memory barrier without assembler.
  12. atomic.StoreInt32(&__sync_synchronize_dummy, atomic.LoadInt32(&__sync_synchronize_dummy)+1)
  13. }