code: public static int getLocalTID(TransactionImpl tran)
      {
          if (tc.isEntryEnabled()) Tr.entry(tc, "getLocalTID", tran);
  
          int id;
          while (true)
          {
              // Capture the current seed value. Do another increment
              // and shift by the difference of current seed. Due to
              // randomness of thread access and Java memory model, this
              // will improve the key space to reduce collisions. Using
              // this approach to avoid using Thread.currentThread() or
              // a ThreadLocal variable.
              final int currSeed = _baseSeed++;
              id = (++_baseSeed << (_baseSeed - currSeed)) & 0x7FFFFFFF;
  
              // Conditionally add the new local tid to the map
              // associating it with the given transaction.
              // This has been modified to use non-optimistic putIfAbsent()
              // to address a race condition if put() is used on its own.
              if (id > 0 && localTIDMap.putIfAbsent(id, tran) == null)
              {
                  // We're done
                  break;
              }
  
              // If there is a clash, generate a new local TID until
              // we find one that is free.
          }
  
          if (tc.isEntryEnabled()) Tr.exit(tc, "getLocalTID", id);
          return id;
      }
docs: Return the next available local tid
  and associate it with the given transaction.
  This method should be used during the
  creation of a new transaction.
  
  @param tran The transaction to be associated
  with the local TID
  
  As suggested by the performance team, the LocalTIDTable used to maintain
  an AtomicLong to maintain a unique value for transaction IDs in multiple threads.
  This is a bottleneck, especially on Power/AIX environments where AtomicLong is
  more costly. The performance team has now provided an implementation that does
  not require any j.u.c. classes, so is more lightweight on all systems, providing
  1%-1.5% performance improvement on the DayTrader benchmark.
  
  @return The next available local TID