RWLocker iface: add TryLock

This commit is contained in:
Roman Khafizianov 2023-02-10 14:23:45 +01:00 committed by Mikhail Iudin
parent d30d79a110
commit f81196eb98
No known key found for this signature in database
GPG Key ID: FAAAA8BAABDFF1C0

View File

@ -4,19 +4,22 @@ package objecttree
import ( import (
"context" "context"
"errors" "errors"
"sync"
"github.com/anytypeio/any-sync/commonspace/object/acl/aclrecordproto" "github.com/anytypeio/any-sync/commonspace/object/acl/aclrecordproto"
list "github.com/anytypeio/any-sync/commonspace/object/acl/list" "github.com/anytypeio/any-sync/commonspace/object/acl/list"
"github.com/anytypeio/any-sync/commonspace/object/tree/treechangeproto" "github.com/anytypeio/any-sync/commonspace/object/tree/treechangeproto"
"github.com/anytypeio/any-sync/commonspace/object/tree/treestorage" "github.com/anytypeio/any-sync/commonspace/object/tree/treestorage"
"github.com/anytypeio/any-sync/util/keys/symmetric" "github.com/anytypeio/any-sync/util/keys/symmetric"
"github.com/anytypeio/any-sync/util/slice" "github.com/anytypeio/any-sync/util/slice"
"sync"
) )
type RWLocker interface { type RWLocker interface {
sync.Locker sync.Locker
RLock() RLock()
RUnlock() RUnlock()
TryRLock() bool
TryLock() bool
} }
var ( var (