Commit 753d82f5 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6fbf83f5
......@@ -16,14 +16,10 @@ package main
import (
"context"
"fmt"
"sync"
// "sync/atomic"
"lab.nexedi.com/kirr/go123/mem"
"lab.nexedi.com/kirr/neo/go/zodb"
pickle "github.com/kisielk/og-rek"
)
// XXX make methods private, e.g. _pJar ?
......@@ -230,11 +226,7 @@ func (obj *object) PActivate(ctx context.Context) (err error) {
doload := (obj.refcnt == 1 && obj.state == GHOST)
defer func() {
if err != nil {
// no need to check for drop - the state is already
// dropped - we just need to decref here.
//
// XXX locking
obj.deactivate() // XXX -> drop?
obj.PDeactivate()
}
}()
if !doload {
......@@ -275,9 +267,7 @@ func (obj *object) PActivate(ctx context.Context) (err error) {
err = obj.instance.SetState(state) // XXX err ctx
state.Release()
}
if err != nil {
obj.instance.DropState() // XXX already in deactivate
} else {
if err == nil {
obj.state = UPTODATE
}
......@@ -289,7 +279,6 @@ func (obj *object) PActivate(ctx context.Context) (err error) {
return err // XXX err ctx
}
// PDeactivate implements Object.
func (obj *object) PDeactivate() {
obj.mu.Lock()
......
......@@ -14,6 +14,15 @@
package main
// Bits that should be in ZODB XXX -> zodb
import (
"context"
"fmt"
"lab.nexedi.com/kirr/neo/go/zodb"
pickle "github.com/kisielk/og-rek"
)
// PyObject is the interface that every in-RAM object representing Python ZODB object implements.
type PyObject interface {
Object
......
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