mirror of
https://github.com/safing/portbase
synced 2025-09-17 02:29:50 +00:00
Fix race condition in database package. Simplify db locking
This commit is contained in:
parent
93a0b27ea2
commit
50a10485e1
3 changed files with 34 additions and 46 deletions
|
@ -22,10 +22,8 @@ func (s *Subscription) Cancel() error {
|
|||
return err
|
||||
}
|
||||
|
||||
c.readLock.Lock()
|
||||
defer c.readLock.Unlock()
|
||||
c.writeLock.Lock()
|
||||
defer c.writeLock.Unlock()
|
||||
c.exclusiveAccess.Lock()
|
||||
defer c.exclusiveAccess.Unlock()
|
||||
|
||||
if s.canceled {
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue