summaryrefslogtreecommitdiffstats
path: root/storageframework/src/tests/thread/tickingthreadtest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'storageframework/src/tests/thread/tickingthreadtest.cpp')
-rw-r--r--storageframework/src/tests/thread/tickingthreadtest.cpp42
1 files changed, 25 insertions, 17 deletions
diff --git a/storageframework/src/tests/thread/tickingthreadtest.cpp b/storageframework/src/tests/thread/tickingthreadtest.cpp
index 3c3c23d244f..508cadc6fbd 100644
--- a/storageframework/src/tests/thread/tickingthreadtest.cpp
+++ b/storageframework/src/tests/thread/tickingthreadtest.cpp
@@ -57,17 +57,8 @@ struct MyApp : public TickingThread {
std::vector<Context> _context;
TickingThreadPool::UP _threadPool;
- MyApp(int threadCount, bool doCritOverlapTest = false)
- : _critOverlapCounter(0),
- _doCritOverlapTest(doCritOverlapTest),
- _critOverlap(false),
- _threadPool(TickingThreadPool::createDefault("testApp"))
- {
- for (int i=0; i<threadCount; ++i) {
- _threadPool->addThread(*this);
- _context.push_back(Context());
- }
- }
+ MyApp(int threadCount, bool doCritOverlapTest = false);
+ ~MyApp();
void start(ThreadPool& p) { _threadPool->start(p); }
@@ -123,6 +114,20 @@ struct MyApp : public TickingThread {
bool hasCritOverlap() { return _critOverlap; }
};
+MyApp::MyApp(int threadCount, bool doCritOverlapTest)
+ : _critOverlapCounter(0),
+ _doCritOverlapTest(doCritOverlapTest),
+ _critOverlap(false),
+ _threadPool(TickingThreadPool::createDefault("testApp"))
+{
+ for (int i=0; i<threadCount; ++i) {
+ _threadPool->addThread(*this);
+ _context.push_back(Context());
+ }
+}
+
+MyApp::~MyApp() { }
+
}
void
@@ -304,12 +309,8 @@ struct BroadcastApp : public TickingThread {
TickingThreadPool::UP _threadPool;
// Set a huge wait time by default to ensure we have to notify
- BroadcastApp()
- : _threadPool(TickingThreadPool::createDefault(
- "testApp", MilliSecTime(300000)))
- {
- _threadPool->addThread(*this);
- }
+ BroadcastApp();
+ ~BroadcastApp();
void start(ThreadPool& p) { _threadPool->start(p); }
@@ -343,6 +344,13 @@ struct BroadcastApp : public TickingThread {
}
};
+BroadcastApp::BroadcastApp()
+ : _threadPool(TickingThreadPool::createDefault("testApp", MilliSecTime(300000)))
+{
+ _threadPool->addThread(*this);
+}
+BroadcastApp::~BroadcastApp() {}
+
}