summaryrefslogtreecommitdiff
path: root/tests/test-Sockets.cc
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2012-04-06 11:40:55 -0700
committerPixel <pixel@nobis-crew.org>2012-04-06 11:40:55 -0700
commitf2cfa1707c713c7bb01d16f4c2c4d96803ea6793 (patch)
treea722f3ad52ec471520097c5bfbbf2ab8cb4e2603 /tests/test-Sockets.cc
parent7fbb819bf6f590bf2337d2277f77487ef7a5ce86 (diff)
Making it simplier to register a task and wait for it. Also renamed createTask to registerTask, which makes way more sense.
Diffstat (limited to 'tests/test-Sockets.cc')
-rw-r--r--tests/test-Sockets.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/test-Sockets.cc b/tests/test-Sockets.cc
index c576c97..4ef0a78 100644
--- a/tests/test-Sockets.cc
+++ b/tests/test-Sockets.cc
@@ -62,11 +62,16 @@ void MainTask::Do() {
Printer::enable(M_ALL);
Printer::log(M_STATUS, "Test::Sockets running.");
- Events::TaskEvent evtSvr(listener = TaskMan::createTask(new Listener<Worker>(1234)));
- Events::TaskEvent evtCln(TaskMan::createTask(new Client));
- Printer::log(M_STATUS, "Created %s", listener->getName());
+ Events::TaskEvent evtSvr;
+ Events::TaskEvent evtCln;
+
+ listener = TaskMan::registerTask(new Listener<Worker>(1234), &evtSvr);
+ TaskMan::registerTask(new Client, &evtCln);
+
waitFor(&evtSvr);
waitFor(&evtCln);
+
+ Printer::log(M_STATUS, "Created %s", listener->getName());
bool svrDone = false, clnDone = false;
while (!svrDone || !clnDone) {
yield();