Commit cf4baa94 authored by Kirill Smelkov's avatar Kirill Smelkov

.

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