gomdb icon indicating copy to clipboard operation
gomdb copied to clipboard

fix thread locking for nested transaction

Open bmatsuo opened this issue 9 years ago • 3 comments

Nested transaction need to know that they are nested so they don't call runtime.UnlockOSThread while their parent is pending.

There's a pretty big warning about thread safety on the godoc for BeginTxn. Maybe at some point the "BUG:" part is removed and this is just a feature of the Txn type. IDK. For now I think it should be considered a bug.

Note: I made the Cursor type aware that it was created from a nested transaction so that its Txn method can work properly (the transaction will not unlock the goroutine on Commit/Abort).

bmatsuo avatar Aug 13 '14 07:08 bmatsuo

@szferi ping. can you take a look at this?

bmatsuo avatar Aug 18 '14 13:08 bmatsuo

Sorry I'm busy I will try to find some time to review it in this week.

szferi avatar Aug 19 '14 10:08 szferi

Ok :smile: Just wanted to make sure you saw it.

bmatsuo avatar Aug 19 '14 10:08 bmatsuo