44#ifndef TEUCHOS_GENERAL_MT_UNITTESTS_HPP
45#define TEUCHOS_GENERAL_MT_UNITTESTS_HPP
51#define TEUCHOS_THREAD_SAFE_UNIT_TESTS_THREADS_USED 4
60static void convenience_log_progress(
int cycle,
int totalCycles) {
62 std::cout <<
"Percent complete: ";
65 int mod = (totalCycles/10);
67 if((cycle % (mod == 0 ? 1 : mod) == 0) || (cycle == totalCycles-1)) {
69 (int)( 100.0f * (
float) cycle / (float) (totalCycles-1) ) <<
"% ";
72 std::flush( std::cout );
82 CatchMemoryLeak() { ++s_countAllocated; }
83 ~CatchMemoryLeak() { --s_countAllocated; }
84 static std::atomic<int> s_countAllocated;
85 static std::atomic<int> s_countDeallocs;
89std::atomic<int> CatchMemoryLeak::s_countAllocated(0);
91std::atomic<int> CatchMemoryLeak::s_countDeallocs(0);
96class ThreadTestManager
100 static std::atomic<bool> s_bAllowThreadsToRun;
103 static std::atomic<bool> s_bMainThreadSetToNull;
105 static std::atomic<int> s_countCompletedThreads;
109 static std::atomic<int> s_countWritingThreadCycles;
111std::atomic<bool> ThreadTestManager::s_bAllowThreadsToRun(
false);
112std::atomic<bool> ThreadTestManager::s_bMainThreadSetToNull(
false);
113std::atomic<int> ThreadTestManager::s_countCompletedThreads(0);
114std::atomic<int> ThreadTestManager::s_countWritingThreadCycles(0);
117#define UNSET_CYCLE_INDEX -1
122struct Cycle_Index_Tracker
124 Cycle_Index_Tracker()
135 int missedDanglingOnFirstCycle;
137 int danglingReference;
145 std::atomic<int> trackCycle;
#define UNSET_CYCLE_INDEX
Teuchos header file which uses auto-configuration information to include necessary C++ headers.