File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 "github.com/sagernet/sing/common"
77)
88
9+ // Deprecated: moved to common.TypedValue
910type TypedValue [T any ] atomic.Pointer [T ]
1011
1112func (t * TypedValue [T ]) Load () T {
Original file line number Diff line number Diff line change 1- //go:build go1.24
2-
31package atomic
42
53import "sync/atomic"
64
75type (
8- Bool = atomic.Bool
9- Int32 = atomic.Int32
10- Int64 = atomic.Int64
11- Uint32 = atomic.Uint32
12- Uint64 = atomic.Uint64
13- Uintptr = atomic.Uintptr
14- Value = atomic.Value
15- Pointer [T any ] = atomic.Pointer [T ]
6+ // Deprecated: use sync/atomic instead
7+ Bool = atomic.Bool
8+ // Deprecated: use sync/atomic instead
9+ Int32 = atomic.Int32
10+ // Deprecated: use sync/atomic instead
11+ Int64 = atomic.Int64
12+ // Deprecated: use sync/atomic instead
13+ Uint32 = atomic.Uint32
14+ // Deprecated: use sync/atomic instead
15+ Uint64 = atomic.Uint64
16+ // Deprecated: use sync/atomic instead
17+ Uintptr = atomic.Uintptr
18+ // Deprecated: use sync/atomic instead
19+ Value = atomic.Value
1620)
1721
18- func PointerForm [T any ](p * atomic.Pointer [T ]) * Pointer [T ] {
19- return p
22+ // Deprecated: use sync/atomic instead
23+ type Pointer [T any ] struct {
24+ atomic.Pointer [T ]
2025}
Load diff This file was deleted.
Original file line number Diff line number Diff line change 44 "crypto/rand"
55 "io"
66 "net"
7+ "sync/atomic"
78
89 "github.com/sagernet/sing/common"
9- "github.com/sagernet/sing/common/atomic"
1010 "github.com/sagernet/sing/common/debug"
1111 E "github.com/sagernet/sing/common/exceptions"
1212 F "github.com/sagernet/sing/common/format"
Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ package bufio
33import (
44 "io"
55 "net"
6+ "sync/atomic"
67
78 "github.com/sagernet/sing/common"
8- "github.com/sagernet/sing/common/atomic"
99 "github.com/sagernet/sing/common/buf"
1010 N "github.com/sagernet/sing/common/network"
1111)
Original file line number Diff line number Diff line change 11package bufio
22
33import (
4+ "sync/atomic"
5+
46 "github.com/sagernet/sing/common"
5- "github.com/sagernet/sing/common/atomic"
67 "github.com/sagernet/sing/common/buf"
78 M "github.com/sagernet/sing/common/metadata"
89 N "github.com/sagernet/sing/common/network"
Original file line number Diff line number Diff line change 55 "os"
66 "time"
77
8- "github.com/sagernet/sing/common/atomic "
8+ "github.com/sagernet/sing/common"
99 "github.com/sagernet/sing/common/buf"
1010 M "github.com/sagernet/sing/common/metadata"
1111 N "github.com/sagernet/sing/common/network"
@@ -24,7 +24,7 @@ type PacketReader interface {
2424
2525type packetReader struct {
2626 TimeoutPacketReader
27- deadline atomic .TypedValue [time.Time ]
27+ deadline common .TypedValue [time.Time ]
2828 pipeDeadline pipeDeadline
2929 result chan * packetReadResult
3030 done chan struct {}
Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ package deadline
33import (
44 "net"
55 "os"
6+ "sync/atomic"
67 "time"
78
8- "github.com/sagernet/sing/common/atomic"
99 "github.com/sagernet/sing/common/buf"
1010 M "github.com/sagernet/sing/common/metadata"
1111)
Original file line number Diff line number Diff line change 55 "os"
66 "time"
77
8- "github.com/sagernet/sing/common/atomic "
8+ "github.com/sagernet/sing/common"
99 "github.com/sagernet/sing/common/buf"
1010 "github.com/sagernet/sing/common/bufio"
1111 N "github.com/sagernet/sing/common/network"
@@ -26,7 +26,7 @@ type Reader interface {
2626type reader struct {
2727 N.ExtendedReader
2828 timeoutReader TimeoutReader
29- deadline atomic .TypedValue [time.Time ]
29+ deadline common .TypedValue [time.Time ]
3030 pipeDeadline pipeDeadline
3131 result chan * readResult
3232 done chan struct {}
Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ package deadline
22
33import (
44 "os"
5+ "sync/atomic"
56 "time"
67
7- "github.com/sagernet/sing/common/atomic"
88 "github.com/sagernet/sing/common/buf"
99)
1010
You can’t perform that action at this time.
0 commit comments