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
f96736a2
Commit
f96736a2
authored
Aug 08, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
fa2905f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
go/zodb/persistent.go
go/zodb/persistent.go
+13
-3
No files found.
go/zodb/persistent.go
View file @
f96736a2
...
...
@@ -147,9 +147,15 @@ func (obj *Persistent) PActivate(ctx context.Context) (err error) {
}
}
if
obj
.
loading
!=
nil
{
obj
.
mu
.
Unlock
()
panic
(
fmt
.
Sprintf
(
"%s(%s): activate: need to load, but .loading != nil"
,
obj
.
zclass
.
class
,
obj
.
oid
))
}
// we become responsible for loading the object
loading
:=
&
loadState
{
ready
:
make
(
chan
struct
{})}
obj
.
loading
=
loading
// XXX assert before it was = nil ?
obj
.
loading
=
loading
obj
.
mu
.
Unlock
()
// do the loading outside of obj lock
...
...
@@ -158,8 +164,12 @@ func (obj *Persistent) PActivate(ctx context.Context) (err error) {
// relock the object
obj
.
mu
.
Lock
()
// XXX assert obj.loading == loading
// XXX assert obj.state == GHOST
if
l
,
s
:=
obj
.
loading
,
obj
.
state
;
!
(
l
==
loading
&&
s
==
GHOST
)
{
obj
.
mu
.
Unlock
()
panic
(
fmt
.
Sprintf
(
"%s(%s): activate: after load: object state unexpected: "
+
"%v (want %v); .loading = %p (want %p)"
,
obj
.
zclass
.
class
,
obj
.
oid
,
s
,
GHOST
,
l
,
loading
))
}
obj
.
serial
=
serial
...
...
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