private void restoreThreadMappings ( Stack stack , Thread thread )
throws IllegalStateException
{
//case 21806: callbacks to ct to be made outside synchronized block
CompositeTransaction tx = (CompositeTransaction) stack.peek ();
tx.addSubTxAwareParticipant ( this ); //step 1
synchronized ( threadtotxmap_ ) {
//between step 1 and here, intermediate timeout/rollback of the ct
//may have happened; make sure to check or we add a thread mapping
//that will never be removed!