private static void Close(TestKernelTransaction tx, CommitterAction committer, TerminatorAction terminator) { try { if (terminator == TerminatorAction.None) { committer.closeNotTerminated(tx); } else { committer.closeTerminated(tx); } } catch (TransactionFailureException e) { throw new Exception(e); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void runTwoThreads(System.Action<TestKernelTransaction> thread1Action, System.Action<TestKernelTransaction> thread2Action) throws Throwable private void RunTwoThreads(System.Action <TestKernelTransaction> thread1Action, System.Action <TestKernelTransaction> thread2Action) { TestKernelTransaction tx = TestKernelTransaction.Create().initialize(); AtomicLong t1Count = new AtomicLong(); AtomicLong t2Count = new AtomicLong(); long endTime = currentTimeMillis() + TEST_RUN_TIME_MS; int limit = 20_000; Race race = new Race(); race.WithEndCondition(() => ((t1Count.get() >= limit) && (t2Count.get() >= limit)) || (currentTimeMillis() >= endTime)); race.AddContestant(() => { thread1Action(tx); t1Count.incrementAndGet(); }); race.AddContestant(() => { thread2Action(tx); t2Count.incrementAndGet(); }); race.Go(); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: abstract void closeNotTerminated(TestKernelTransaction tx) throws org.neo4j.internal.kernel.api.exceptions.TransactionFailureException; internal abstract void closeNotTerminated(TestKernelTransaction tx);