Commit af8daaed authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 21691ac6
...@@ -895,10 +895,10 @@ retry: ...@@ -895,10 +895,10 @@ retry:
// XXX for f in δF: f.δtail.ForgetPast(...) // XXX for f in δF: f.δtail.ForgetPast(...)
// notify zhead.At waiters // notify zhead.At waiters
for w := range head.hwait { for hw := range head.hwait {
if w.at <= δZ.Tid { if hw.at <= δZ.Tid {
delete(head.hwait, w) delete(head.hwait, hw)
close(w.ready) close(hw.ready)
} }
} }
...@@ -1384,7 +1384,7 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) { ...@@ -1384,7 +1384,7 @@ func (w *Watch) _pin(ctx context.Context, blk int64, rev zodb.Tid) (err error) {
} }
// readPinWatchers complements readBlk: it sends `pin blk` for watchers of the file // readPinWatchers complements readBlk: it sends `pin blk` for watchers of the file
// after a block was loaded from ZODB and before block data is returned to kernel. // after a block was loaded from ZODB but before block data is returned to kernel.
// //
// See "7.2) for all registered client@at watchers ..." // See "7.2) for all registered client@at watchers ..."
// //
...@@ -1407,7 +1407,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr ...@@ -1407,7 +1407,7 @@ func (f *BigFile) readPinWatchers(ctx context.Context, blk int64, treepath []btr
bfdir.δFtail.Track(f, blk, treepath, zblk) // XXX pass in zblk.rev here? bfdir.δFtail.Track(f, blk, treepath, zblk) // XXX pass in zblk.rev here?
bfdir.δFmu.Unlock() bfdir.δFmu.Unlock()
// makes sure that file[blk] on clients side stays as of @w.at state. // make sure that file[blk] on clients side stays as of @w.at state.
// try to use blkrevMax only as the first cheap criteria to skip updating watchers. // try to use blkrevMax only as the first cheap criteria to skip updating watchers.
// This is likely to be the case, since most watchers should be usually close to head. // This is likely to be the case, since most watchers should be usually close to head.
...@@ -1534,7 +1534,7 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T ...@@ -1534,7 +1534,7 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
// request exclusive access to the watch to change .at and compute pins. // request exclusive access to the watch to change .at and compute pins.
// The lock will be downgraded from W to R after pins computation is done. // The lock will be downgraded from W to R after pins computation is done.
// Pins will be executed with atMu.R only - with the idea not to block // Pins will be executed with atMu.R only - with the idea not to block
// other client that read-access the file simultaneously to setupWatch. // other clients that read-access the file simultaneously to setupWatch.
w.atMu.Lock() w.atMu.Lock()
// check at >= w.at // check at >= w.at
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment