int acquireTransaction ( @ NotNull final Thread thread ) { try ( CriticalSection ignored = criticalSection . enter ( ) ) { final int currentThreadPermits = getThreadPermitsToAcquire ( thread ) ; waitForPermits ( thread , currentThreadPermits > 0 ? nestedQueue : regularQueue , 1 , currentThreadPermits ) ; } return 1 ; }
Acquire transaction with a single permit in a thread . Transactions are acquired reentrantly i . e . with respect to transactions already acquired in the thread .