Files
core/udt/atomic_uint32.go
Kleissner 75e3d9a42e Initial UDT implementation for file transfer.
New function RequestFileTransferUDT to download files from other peers.
2021-10-24 04:26:30 +02:00

18 lines
229 B
Go

package udt
import (
"sync/atomic"
)
type atomicUint32 struct {
val uint32
}
func (s *atomicUint32) get() uint32 {
return atomic.LoadUint32(&s.val)
}
func (s *atomicUint32) set(v uint32) {
atomic.StoreUint32(&s.val, v)
}