sync.go (489B)
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 5 package libc // import "modernc.org/libc" 6 7 import ( 8 "sync/atomic" 9 ) 10 11 var __sync_synchronize_dummy int32 12 13 // __sync_synchronize(); 14 func X__sync_synchronize(t *TLS) { 15 // Attempt to implement a full memory barrier without assembler. 16 atomic.StoreInt32(&__sync_synchronize_dummy, atomic.LoadInt32(&__sync_synchronize_dummy)+1) 17 }