change sync to detect deadlock

This commit is contained in:
YouROK
2020-12-28 12:41:09 +03:00
parent 611f9e955b
commit e026072067
9 changed files with 10 additions and 9 deletions

View File

@@ -2,8 +2,8 @@ package settings
import ( import (
"encoding/json" "encoding/json"
sync "github.com/sasha-s/go-deadlock"
"sort" "sort"
"sync"
"github.com/anacrolix/torrent" "github.com/anacrolix/torrent"
"github.com/anacrolix/torrent/metainfo" "github.com/anacrolix/torrent/metainfo"

View File

@@ -1,8 +1,8 @@
package torr package torr
import ( import (
sync "github.com/sasha-s/go-deadlock"
"log" "log"
"sync"
"time" "time"
"server/settings" "server/settings"

View File

@@ -2,7 +2,7 @@ package torrstor
import ( import (
"fmt" "fmt"
"sync" sync "github.com/sasha-s/go-deadlock"
) )
type buffer struct { type buffer struct {

View File

@@ -1,8 +1,8 @@
package torrstor package torrstor
import ( import (
sync "github.com/sasha-s/go-deadlock"
"sort" "sort"
"sync"
"github.com/anacrolix/torrent" "github.com/anacrolix/torrent"
"server/log" "server/log"

View File

@@ -2,8 +2,8 @@ package torrstor
import ( import (
"errors" "errors"
sync "github.com/sasha-s/go-deadlock"
"io" "io"
"sync"
"time" "time"
"github.com/anacrolix/torrent/storage" "github.com/anacrolix/torrent/storage"

View File

@@ -1,8 +1,8 @@
package torrstor package torrstor
import ( import (
sync "github.com/sasha-s/go-deadlock"
"io" "io"
"sync"
"github.com/anacrolix/torrent" "github.com/anacrolix/torrent"
"server/log" "server/log"

View File

@@ -1,7 +1,7 @@
package torrstor package torrstor
import ( import (
"sync" sync "github.com/sasha-s/go-deadlock"
"server/torr/storage" "server/torr/storage"

View File

@@ -5,9 +5,10 @@ import (
"fmt" "fmt"
"io" "io"
"sort" "sort"
"sync"
"time" "time"
sync "github.com/sasha-s/go-deadlock"
"server/log" "server/log"
"server/settings" "server/settings"
"server/torr/state" "server/torr/state"

View File

@@ -1,7 +1,7 @@
package utils package utils
import ( import (
"sync" sync "github.com/sasha-s/go-deadlock"
) )
func ParallelFor(begin, end int, fn func(i int)) { func ParallelFor(begin, end int, fn func(i int)) {