]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
ThreadEngine::GetName(), for display in /version
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 21 Feb 2008 17:59:26 +0000 (17:59 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 21 Feb 2008 17:59:26 +0000 (17:59 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8985 e03df62e-2008-0410-955e-edbf42e46eb7

include/threadengine.h
include/threadengines/threadengine_pthread.h
src/testsuite.cpp

index 397b0085e46ba02604ce6cbfd043ca533c6d8ce0..59d425481bc142aca3a878e987b9d514b4f835cd 100644 (file)
@@ -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
index 7e4d4ec3f1dc6867253243bc9095fdd843acdb01..c34ff6fd35910dac9fe8f6b155ddaa99547b7a09 100644 (file)
@@ -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
index 841c1c41bdab2c5dff3600410428a795ec2511a6..2396f142c4a57ce76359340afa2e434e0134d575 100644 (file)
@@ -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";