Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
69181fdb
Commit
69181fdb
authored
Jul 01, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
facc6db8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
wcfs/wcfs.go
wcfs/wcfs.go
+7
-4
No files found.
wcfs/wcfs.go
View file @
69181fdb
...
...
@@ -509,7 +509,7 @@ type Head struct {
// XXX protected by ... zheadMu ?
wlinkTab
map
[
*
WatchLink
]
struct
{}
// waiters for z
conn
.At to become ≥ their at.
// waiters for z
head
.At to become ≥ their at.
hwaitMu
sync
.
Mutex
// zheadMu.W | zheadMu.R + hwaitMu
hwait
map
[
hwaiter
]
struct
{}
// set{(at, ready)}
}
...
...
@@ -560,7 +560,7 @@ type BigFile struct {
//
// Being a staging area for data to enter OS cache, loading has to be
// consulted/invalidated whenever wcfs logic needs to consult/invalidate OS cache.
loadMu
sync
.
Mutex
// XXX doc zheadMu.W | ... ?
loadMu
sync
.
Mutex
// zheadMu.W | zheadMu.R + loadMu
loading
map
[
int64
]
*
blkLoadState
// #blk -> {... blkdata}
// watches attached to this file.
...
...
@@ -891,7 +891,7 @@ type hwaiter struct {
// zheadWait waits till head.zconn.At becomes ≥ at.
//
// It returns error either if
db is down or ctx is canceled. XXX db -> wcfs?
// It returns error either if
wcfs is down or ctx is canceled.
func
(
head
*
Head
)
zheadWait
(
ctx
context
.
Context
,
at
zodb
.
Tid
)
(
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"wait zhead ≥ %s"
,
at
)
...
...
@@ -899,11 +899,13 @@ func (head *Head) zheadWait(ctx context.Context, at zodb.Tid) (err error) {
panic
(
"must be called only for head/, not @revX/"
)
}
// XXX check wcfs.down
// check if zhead is already ≥ at
head
.
zheadMu
.
RLock
()
if
head
.
zconn
.
At
()
>=
at
{
head
.
zheadMu
.
RUnlock
()
return
return
nil
}
// no - we have to wait for it
...
...
@@ -1281,6 +1283,7 @@ retry:
break
}
// zheadMu rlocked.
// zwatcher is not currently trying to pause OS cache uploads.
// check if this block was already invalidated by zwatcher.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment