From 6bd1e79d98f95115c356a9e3e7fdb02dcf221a4e Mon Sep 17 00:00:00 2001 From: Pixel Date: Mon, 17 Oct 2011 20:52:59 -0700 Subject: Forgot test-Threads.cc --- tests/test-Threads.cc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/test-Threads.cc (limited to 'tests') diff --git a/tests/test-Threads.cc b/tests/test-Threads.cc new file mode 100644 index 0000000..daebf5f --- /dev/null +++ b/tests/test-Threads.cc @@ -0,0 +1,28 @@ +#include +#include + +BALAU_STARTUP; + +using namespace Balau; + +class TestThread : public Thread { + private: + virtual void * proc(); +}; + +void * TestThread::proc() { + Printer::log(M_STATUS, "Into a thread"); +} + +void MainTask::Do() { + Printer::log(M_STATUS, "Test::Threads running."); + + TestThread * t = new TestThread(); + Printer::log(M_STATUS, "Starting thread"); + t->threadStart(); + Printer::log(M_STATUS, "Joining thread"); + t->join(); + delete t; + + Printer::log(M_STATUS, "Test::Threads passed."); +} -- cgit v1.2.3