Commit 169e2441 authored by Jim Fulton's avatar Jim Fulton

Changed to propigate errors raised by _begin.

Also changed completion code to check registered status and
avoid completion logic if not registered, which would be the case if
_begin failed.
parent 70cc0d1e
...@@ -99,17 +99,20 @@ class THUNKED_TM(TM.TM): ...@@ -99,17 +99,20 @@ class THUNKED_TM(TM.TM):
self._begin() self._begin()
except: except:
thunk_lock.release() thunk_lock.release()
raise
else: else:
self._registered=1 self._registered=1
def tpc_finish(self, *ignored): def tpc_finish(self, *ignored):
try: self._finish() if self._registered:
finally: try: self._finish()
thunk_lock.release() finally:
self._registered=0 thunk_lock.release()
self._registered=0
def abort(self, *ignored): def abort(self, *ignored):
try: self._abort() if self._registered:
finally: try: self._abort()
thunk_lock.release() finally:
self._registered=0 thunk_lock.release()
self._registered=0
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