]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Inlineable `(*Torrent).Seeding()` (#626)
authorYenForYang <YenForYang@users.noreply.github.com>
Wed, 15 Sep 2021 00:28:14 +0000 (19:28 -0500)
committerGitHub <noreply@github.com>
Wed, 15 Sep 2021 00:28:14 +0000 (10:28 +1000)
t.go

diff --git a/t.go b/t.go
index 5fa9f3ddc22921e1b5ba1352b4040d16f719cf6a..2c076386b0856899d44fa657b74d2c92c51c4b14 100644 (file)
--- a/t.go
+++ b/t.go
@@ -124,10 +124,11 @@ func (t *Torrent) SubscribePieceStateChanges() *pubsub.Subscription {
 
 // Returns true if the torrent is currently being seeded. This occurs when the
 // client is willing to upload without wanting anything in return.
-func (t *Torrent) Seeding() bool {
+func (t *Torrent) Seeding() (ret bool) {
        t.cl.lock()
-       defer t.cl.unlock()
-       return t.seeding()
+       ret = t.seeding()
+       t.cl.unlock()
+       return
 }
 
 // Clobbers the torrent display name if metainfo is unavailable.