Add partial deadlock detection in debug mode

This commit is contained in:
Tulir Asokan
2019-04-27 15:02:52 +03:00
parent bc7e2d9a1c
commit 6f54066c43
9 changed files with 79 additions and 23 deletions

View File

@ -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 {

View File

@ -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,
}
}