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
f1b89b31
Commit
f1b89b31
authored
Jul 19, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
41db5fd6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
wcfs/zodb.go
wcfs/zodb.go
+9
-9
wcfs/zodbpy.go
wcfs/zodbpy.go
+3
-3
No files found.
wcfs/zodb.go
View file @
f1b89b31
...
...
@@ -96,8 +96,8 @@ const (
// no STICKY - we pin objects in RAM with PActivate
)
//
objec
t is common base implementation for in-RAM representation of ZODB objects.
type
objec
t
struct
{
//
Persisten
t is common base implementation for in-RAM representation of ZODB objects.
type
Persisten
t
struct
{
jar
*
Connection
oid
zodb
.
Oid
serial
zodb
.
Tid
...
...
@@ -105,13 +105,13 @@ type object struct {
mu
sync
.
Mutex
state
ObjectState
refcnt
int32
instance
IPersistent
//
objec
t should be the base for the instance
instance
IPersistent
//
Persisten
t should be the base for the instance
loading
*
loadState
}
func
(
obj
*
objec
t
)
PJar
()
*
Connection
{
return
obj
.
jar
}
func
(
obj
*
objec
t
)
POid
()
zodb
.
Oid
{
return
obj
.
oid
}
func
(
obj
*
objec
t
)
PSerial
()
zodb
.
Tid
{
return
obj
.
serial
}
func
(
obj
*
Persisten
t
)
PJar
()
*
Connection
{
return
obj
.
jar
}
func
(
obj
*
Persisten
t
)
POid
()
zodb
.
Oid
{
return
obj
.
oid
}
func
(
obj
*
Persisten
t
)
PSerial
()
zodb
.
Tid
{
return
obj
.
serial
}
// loadState indicates object's load state/result.
//
...
...
@@ -227,7 +227,7 @@ type LiveCacheControl interface {
// ---- activate/deactivate/invalidate ----
// PActivate implements IPersistent.
func
(
obj
*
objec
t
)
PActivate
(
ctx
context
.
Context
)
(
err
error
)
{
func
(
obj
*
Persisten
t
)
PActivate
(
ctx
context
.
Context
)
(
err
error
)
{
obj
.
mu
.
Lock
()
obj
.
refcnt
++
doload
:=
(
obj
.
refcnt
==
1
&&
obj
.
state
==
GHOST
)
...
...
@@ -284,7 +284,7 @@ func (obj *object) PActivate(ctx context.Context) (err error) {
}
// PDeactivate implements IPersistent.
func
(
obj
*
objec
t
)
PDeactivate
()
{
func
(
obj
*
Persisten
t
)
PDeactivate
()
{
obj
.
mu
.
Lock
()
defer
obj
.
mu
.
Unlock
()
...
...
@@ -314,7 +314,7 @@ func (obj *object) PDeactivate() {
}
// PInvalidate() implements IPersistent.
func
(
obj
*
objec
t
)
PInvalidate
()
{
func
(
obj
*
Persisten
t
)
PInvalidate
()
{
obj
.
mu
.
Lock
()
defer
obj
.
mu
.
Unlock
()
...
...
wcfs/zodbpy.go
View file @
f1b89b31
...
...
@@ -40,7 +40,7 @@ type IPyPersistent interface {
// pyObject is common base implementation for in-RAM representation of ZODB Python objects.
type
pyObject
struct
{
objec
t
Persisten
t
pyclass
pickle
.
Class
}
...
...
@@ -59,7 +59,7 @@ type PyStateful interface {
//PyGetState() interface{} TODO
}
// ---- pyObject <->
objec
t state exchange ----
// ---- pyObject <->
Persisten
t state exchange ----
// pyinstance returns .instance upcasted to IPyPersistent.
//
...
...
@@ -106,7 +106,7 @@ func registerPyClass(pyClassPath string, classNew pyClassNewFunc) {
// newGhost creates new ghost object corresponding to pyclass and oid.
func
(
conn
*
Connection
)
newGhost
(
pyclass
pickle
.
Class
,
oid
zodb
.
Oid
)
IPyPersistent
{
pyobj
:=
&
pyObject
{
object
:
objec
t
{
jar
:
conn
,
oid
:
oid
,
serial
:
0
,
state
:
GHOST
},
Persistent
:
Persisten
t
{
jar
:
conn
,
oid
:
oid
,
serial
:
0
,
state
:
GHOST
},
pyclass
:
pyclass
,
}
...
...
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