Skip to content

Commit

Permalink
track peer lock not client
Browse files Browse the repository at this point in the history
  • Loading branch information
mh0lt committed Jul 10, 2024
1 parent 99d65bf commit 1453b96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion deferrwl.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package torrent

import "github.com/anacrolix/sync"

// Runs deferred actions on Unlock. Note that actions are assumed to be the results of changes that
// would only occur with a write lock at present. The race detector should catch instances of defers
// without the write lock being held.
type lockWithDeferreds struct {
internal mu //sync.RWMutex
internal sync.RWMutex
unlockActions []func()
}

Expand Down
2 changes: 1 addition & 1 deletion peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type (
Peer struct {
// First to ensure 64-bit alignment for atomics. See #262.
_stats ConnStats
mu sync.RWMutex
mu mu //sync.RWMutex

t *Torrent

Expand Down

0 comments on commit 1453b96

Please sign in to comment.