gomdb
gomdb copied to clipboard
fix thread locking for nested transaction
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).
@szferi ping. can you take a look at this?
Sorry I'm busy I will try to find some time to review it in this week.
Ok :smile: Just wanted to make sure you saw it.