Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
b1aa6178
Commit
b1aa6178
authored
Mar 06, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
80b82f0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
go/zodb/db.go
go/zodb/db.go
+4
-5
No files found.
go/zodb/db.go
View file @
b1aa6178
...
@@ -284,15 +284,16 @@ type hwaiter struct {
...
@@ -284,15 +284,16 @@ type hwaiter struct {
// headWait waits till db.Head becomes ≥ at.
// headWait waits till db.Head becomes ≥ at.
//
//
//
Must be called db.mu releas
ed.
//
It returns error either if db is down or ctx is cancel
ed.
//
//
//
XXX -> waitHead? needHead? waitHeadAfter? ensureAt?
//
Must be called db.mu released.
func
(
db
*
DB
)
headWait
(
ctx
context
.
Context
,
at
Tid
)
(
err
error
)
{
func
(
db
*
DB
)
headWait
(
ctx
context
.
Context
,
at
Tid
)
(
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"wait head ≥ %s"
,
at
)
db
.
mu
.
Lock
()
db
.
mu
.
Lock
()
// XXX check if db is already down -> error even if at is under coverage?
// XXX check if db is already down -> error even if at is under coverage?
// XXX under mu - ok?
// XXX under mu - ok?
// XXX err ctx
if
ready
(
db
.
down
)
{
if
ready
(
db
.
down
)
{
return
db
.
downErr
return
db
.
downErr
}
}
...
@@ -308,8 +309,6 @@ func (db *DB) headWait(ctx context.Context, at Tid) (err error) {
...
@@ -308,8 +309,6 @@ func (db *DB) headWait(ctx context.Context, at Tid) (err error) {
db
.
hwait
[
hwaiter
{
at
,
δready
}]
=
struct
{}{}
db
.
hwait
[
hwaiter
{
at
,
δready
}]
=
struct
{}{}
db
.
mu
.
Unlock
()
db
.
mu
.
Unlock
()
defer
xerr
.
Contextf
(
&
err
,
"wait head ≥ %s"
,
at
)
select
{
select
{
case
<-
δready
:
case
<-
δready
:
// ok - δtail.head went over at
// ok - δtail.head went over at
...
...
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