add tcp server

This commit is contained in:
hdt3213
2019-06-02 11:42:04 +08:00
committed by wyb
parent 4e26f7b859
commit 65c23dcf6b
13 changed files with 433 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
package atomic
import "sync/atomic"
type AtomicBool uint32
func (b *AtomicBool)Get()bool {
return atomic.LoadUint32((*uint32)(b)) != 0
}
func (b *AtomicBool)Set(v bool) {
if v {
atomic.StoreUint32((*uint32)(b), 1)
} else {
atomic.StoreUint32((*uint32)(b), 0)
}
}