summaryrefslogtreecommitdiff
path: root/tests/test-Threads.cc
blob: daebf5f9483764a7d45d3ba8771c2494360c92ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <Main.h>
#include <Threads.h>

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.");
}