Commit cf4baa94 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 39fcf48d
...@@ -138,6 +138,10 @@ func (txn *transaction) Abort() { ...@@ -138,6 +138,10 @@ func (txn *transaction) Abort() {
wg.Wait() wg.Wait()
// XXX set txn status // XXX set txn status
txn.mu.Lock()
// assert .status == Aborting
txn.status = Aborted // XXX what if errBeforeCompletion?
txn.mu.Unlock()
// sync.AfterCompletion // sync.AfterCompletion
n = len(syncv) n = len(syncv)
......
...@@ -95,8 +95,8 @@ func TestAbort(t *testing.T) { ...@@ -95,8 +95,8 @@ func TestAbort(t *testing.T) {
// XXX +sync // XXX +sync
txn.Abort() txn.Abort()
if dm.nabort != 1 { if !(dm.nabort == 1 && txn.Status() == Aborted) {
t.Fatalf("abort: nabort=%d; want=1", dm.nabort) t.Fatalf("abort: nabort=%d; txn.Status=%v", dm.nabort, txn.Status())
} }
// txn.Abort() -> panic XXX // txn.Abort() -> panic XXX
......
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