Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.51
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
go /
src /
runtime /
race /
testdata /
[ HOME SHELL ]
Name
Size
Permission
Action
atomic_test.go
4.43
KB
-rw-r--r--
cgo_test.go
497
B
-rw-r--r--
cgo_test_main.go
415
B
-rw-r--r--
chan_test.go
10.15
KB
-rw-r--r--
comp_test.go
2.25
KB
-rw-r--r--
finalizer_test.go
1.05
KB
-rw-r--r--
io_test.go
1.33
KB
-rw-r--r--
issue12225_test.go
455
B
-rw-r--r--
issue12664_test.go
1.09
KB
-rw-r--r--
issue13264_test.go
310
B
-rw-r--r--
map_test.go
5.12
KB
-rw-r--r--
mop_test.go
27.82
KB
-rw-r--r--
mutex_test.go
1.85
KB
-rw-r--r--
pool_test.go
949
B
-rw-r--r--
reflect_test.go
811
B
-rw-r--r--
regression_test.go
2.74
KB
-rw-r--r--
rwmutex_test.go
2.08
KB
-rw-r--r--
select_test.go
4.08
KB
-rw-r--r--
slice_test.go
8.64
KB
-rw-r--r--
sync_test.go
2.96
KB
-rw-r--r--
waitgroup_test.go
5.27
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : atomic_test.go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package race_test import ( "runtime" "sync" "sync/atomic" "testing" "unsafe" ) func TestNoRaceAtomicAddInt64(t *testing.T) { var x1, x2 int8 _ = x1 + x2 var s int64 ch := make(chan bool, 2) go func() { x1 = 1 if atomic.AddInt64(&s, 1) == 2 { x2 = 1 } ch <- true }() go func() { x2 = 1 if atomic.AddInt64(&s, 1) == 2 { x1 = 1 } ch <- true }() <-ch <-ch } func TestRaceAtomicAddInt64(t *testing.T) { var x1, x2 int8 _ = x1 + x2 var s int64 ch := make(chan bool, 2) go func() { x1 = 1 if atomic.AddInt64(&s, 1) == 1 { x2 = 1 } ch <- true }() go func() { x2 = 1 if atomic.AddInt64(&s, 1) == 1 { x1 = 1 } ch <- true }() <-ch <-ch } func TestNoRaceAtomicAddInt32(t *testing.T) { var x1, x2 int8 _ = x1 + x2 var s int32 ch := make(chan bool, 2) go func() { x1 = 1 if atomic.AddInt32(&s, 1) == 2 { x2 = 1 } ch <- true }() go func() { x2 = 1 if atomic.AddInt32(&s, 1) == 2 { x1 = 1 } ch <- true }() <-ch <-ch } func TestNoRaceAtomicLoadAddInt32(t *testing.T) { var x int64 _ = x var s int32 go func() { x = 2 atomic.AddInt32(&s, 1) }() for atomic.LoadInt32(&s) != 1 { runtime.Gosched() } x = 1 } func TestNoRaceAtomicLoadStoreInt32(t *testing.T) { var x int64 _ = x var s int32 go func() { x = 2 atomic.StoreInt32(&s, 1) }() for atomic.LoadInt32(&s) != 1 { runtime.Gosched() } x = 1 } func TestNoRaceAtomicStoreCASInt32(t *testing.T) { var x int64 _ = x var s int32 go func() { x = 2 atomic.StoreInt32(&s, 1) }() for !atomic.CompareAndSwapInt32(&s, 1, 0) { runtime.Gosched() } x = 1 } func TestNoRaceAtomicCASLoadInt32(t *testing.T) { var x int64 _ = x var s int32 go func() { x = 2 if !atomic.CompareAndSwapInt32(&s, 0, 1) { panic("") } }() for atomic.LoadInt32(&s) != 1 { runtime.Gosched() } x = 1 } func TestNoRaceAtomicCASCASInt32(t *testing.T) { var x int64 _ = x var s int32 go func() { x = 2 if !atomic.CompareAndSwapInt32(&s, 0, 1) { panic("") } }() for !atomic.CompareAndSwapInt32(&s, 1, 0) { runtime.Gosched() } x = 1 } func TestNoRaceAtomicCASCASInt32_2(t *testing.T) { var x1, x2 int8 _ = x1 + x2 var s int32 ch := make(chan bool, 2) go func() { x1 = 1 if !atomic.CompareAndSwapInt32(&s, 0, 1) { x2 = 1 } ch <- true }() go func() { x2 = 1 if !atomic.CompareAndSwapInt32(&s, 0, 1) { x1 = 1 } ch <- true }() <-ch <-ch } func TestNoRaceAtomicLoadInt64(t *testing.T) { var x int32 _ = x var s int64 go func() { x = 2 atomic.AddInt64(&s, 1) }() for atomic.LoadInt64(&s) != 1 { runtime.Gosched() } x = 1 } func TestNoRaceAtomicCASCASUInt64(t *testing.T) { var x int64 _ = x var s uint64 go func() { x = 2 if !atomic.CompareAndSwapUint64(&s, 0, 1) { panic("") } }() for !atomic.CompareAndSwapUint64(&s, 1, 0) { runtime.Gosched() } x = 1 } func TestNoRaceAtomicLoadStorePointer(t *testing.T) { var x int64 _ = x var s unsafe.Pointer var y int = 2 var p unsafe.Pointer = unsafe.Pointer(&y) go func() { x = 2 atomic.StorePointer(&s, p) }() for atomic.LoadPointer(&s) != p { runtime.Gosched() } x = 1 } func TestNoRaceAtomicStoreCASUint64(t *testing.T) { var x int64 _ = x var s uint64 go func() { x = 2 atomic.StoreUint64(&s, 1) }() for !atomic.CompareAndSwapUint64(&s, 1, 0) { runtime.Gosched() } x = 1 } func TestRaceAtomicStoreLoad(t *testing.T) { c := make(chan bool) var a uint64 go func() { atomic.StoreUint64(&a, 1) c <- true }() _ = a <-c } func TestRaceAtomicLoadStore(t *testing.T) { c := make(chan bool) var a uint64 go func() { _ = atomic.LoadUint64(&a) c <- true }() a = 1 <-c } func TestRaceAtomicAddLoad(t *testing.T) { c := make(chan bool) var a uint64 go func() { atomic.AddUint64(&a, 1) c <- true }() _ = a <-c } func TestRaceAtomicAddStore(t *testing.T) { c := make(chan bool) var a uint64 go func() { atomic.AddUint64(&a, 1) c <- true }() a = 42 <-c } // A nil pointer in an atomic operation should not deadlock // the rest of the program. Used to hang indefinitely. func TestNoRaceAtomicCrash(t *testing.T) { var mutex sync.Mutex var nilptr *int32 panics := 0 defer func() { if x := recover(); x != nil { mutex.Lock() panics++ mutex.Unlock() } else { panic("no panic") } }() atomic.AddInt32(nilptr, 1) }
Close