diff options
-rw-r--r-- | include/threadengine.h | 5 | ||||
-rw-r--r-- | include/threadengines/threadengine_pthread.h | 5 | ||||
-rw-r--r-- | src/testsuite.cpp | 6 |
3 files changed, 13 insertions, 3 deletions
diff --git a/include/threadengine.h b/include/threadengine.h index 397b0085e..59d425481 100644 --- a/include/threadengine.h +++ b/include/threadengine.h @@ -75,6 +75,11 @@ class CoreExport ThreadEngine : public Extensible * is responsible for destroying it. */ virtual void FreeThread(Thread* thread) = 0; + + virtual const std::string GetName() + { + return "<pure-virtual>"; + } }; /** Derive from this class to implement your own threaded sections of diff --git a/include/threadengines/threadengine_pthread.h b/include/threadengines/threadengine_pthread.h index 7e4d4ec3f..c34ff6fd3 100644 --- a/include/threadengines/threadengine_pthread.h +++ b/include/threadengines/threadengine_pthread.h @@ -38,6 +38,11 @@ class CoreExport PThreadEngine : public ThreadEngine void Create(Thread* thread_to_init); void FreeThread(Thread* thread); + + const std::string GetName() + { + return "posix-thread"; + } }; class ThreadEngineFactory : public classbase diff --git a/src/testsuite.cpp b/src/testsuite.cpp index 841c1c41b..2396f142c 100644 --- a/src/testsuite.cpp +++ b/src/testsuite.cpp @@ -108,12 +108,12 @@ bool TestSuite::DoThreadTests() cout << "Creation failed, test failure.\n"; return false; } - cout << "Creation success!\n"; + cout << "Creation success, type " << te->GetName() << "\n"; - cout << "Creating new thread of type TestSuiteThread...\n"; + cout << "Allocate: new TestSuiteThread...\n"; TestSuiteThread* tst = new TestSuiteThread(); - cout << "Create new thread based on TestSuiteThread...\n"; + cout << "ThreadEngine::Create on TestSuiteThread...\n"; te->Create(tst); cout << "Type any line and press enter to end test.\n"; |