aboutsummaryrefslogtreecommitdiff
path: root/matrix
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2019-04-27 15:02:52 +0300
committerTulir Asokan <tulir@maunium.net>2019-04-27 15:02:52 +0300
commit6f54066c43172fe0197e82fb1034c9ae55d1e1f2 (patch)
tree8136e34231de96d9557f2fc0f12e499ca6c2978f /matrix
parentbc7e2d9a1c871e3fbce932f9695fc24083bc2cc4 (diff)
Add partial deadlock detection in debug mode
Diffstat (limited to 'matrix')
-rw-r--r--matrix/history.go6
-rw-r--r--matrix/rooms/room.go5
2 files changed, 6 insertions, 5 deletions
diff --git a/matrix/history.go b/matrix/history.go
index 0cfb84e..767cace 100644
--- a/matrix/history.go
+++ b/matrix/history.go
@@ -20,8 +20,8 @@ import (
"bytes"
"encoding/binary"
"encoding/gob"
- "sync"
+ sync "github.com/sasha-s/go-deadlock"
bolt "go.etcd.io/bbolt"
"maunium.net/go/gomuks/matrix/rooms"
@@ -49,8 +49,8 @@ func NewHistoryManager(dbPath string) (*HistoryManager, error) {
historyLoadPtr: make(map[*rooms.Room]uint64),
}
db, err := bolt.Open(dbPath, 0600, &bolt.Options{
- Timeout: 1,
- NoGrowSync: false,
+ Timeout: 1,
+ NoGrowSync: false,
FreelistType: bolt.FreelistArrayType,
})
if err != nil {
diff --git a/matrix/rooms/room.go b/matrix/rooms/room.go
index 6334036..717636b 100644
--- a/matrix/rooms/room.go
+++ b/matrix/rooms/room.go
@@ -21,9 +21,10 @@ import (
"fmt"
"os"
"sort"
- "sync"
"time"
+ sync "github.com/sasha-s/go-deadlock"
+
"maunium.net/go/mautrix"
"maunium.net/go/gomuks/debug"
@@ -450,7 +451,7 @@ func (room *Room) GetSessionOwner() string {
// NewRoom creates a new Room with the given ID
func NewRoom(roomID, owner string) *Room {
return &Room{
- Room: mautrix.NewRoom(roomID),
+ Room: mautrix.NewRoom(roomID),
SessionUserID: owner,
}
}