/
atomic.go
69 lines (54 loc) · 1.25 KB
/
atomic.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package atomic
import (
"time"
"unsafe"
"go.uber.org/atomic"
)
type Bool = atomic.Bool
type Duration = atomic.Duration
type Error = atomic.Error
type Float64 = atomic.Float64
type Int32 = atomic.Int32
type Int64 = atomic.Int64
type String = atomic.String
type Time = atomic.Time
type Uint32 = atomic.Uint32
type Uint64 = atomic.Uint64
type Uintptr = atomic.Uintptr
type UnsafePointer = atomic.UnsafePointer
func NewBool(val bool) *Bool {
return atomic.NewBool(val)
}
func NewDuration(val time.Duration) *Duration {
return atomic.NewDuration(val)
}
func NewError(val error) *Error {
return atomic.NewError(val)
}
func NewFloat64(val float64) *Float64 {
return atomic.NewFloat64(val)
}
func NewInt32(val int32) *Int32 {
return atomic.NewInt32(val)
}
func NewInt64(val int64) *Int64 {
return atomic.NewInt64(val)
}
func NewString(val string) *String {
return atomic.NewString(val)
}
func NewTime(val time.Time) *Time {
return atomic.NewTime(val)
}
func NewUint32(val uint32) *Uint32 {
return atomic.NewUint32(val)
}
func NewUint64(val uint64) *Uint64 {
return atomic.NewUint64(val)
}
func NewUintptr(val uintptr) *Uintptr {
return atomic.NewUintptr(val)
}
func NewUnsafePointer(val unsafe.Pointer) *UnsafePointer {
return atomic.NewUnsafePointer(val)
}