From d5193b058ca06db9bda772ccdf49a8c4976c7274 Mon Sep 17 00:00:00 2001 From: Comment Date: Sun, 24 Feb 2013 23:24:18 +0000 Subject: working threading --- rotord/rotord.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'rotord/rotord.cpp') diff --git a/rotord/rotord.cpp b/rotord/rotord.cpp index 1843c9c..cb106d0 100755 --- a/rotord/rotord.cpp +++ b/rotord/rotord.cpp @@ -145,13 +145,15 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS if (command.size()) { if (command[0]=="new") { string sID=idGen.create().toString(); - context[sID]=Rotor::Render_context(); - pool.start(context[sID]); + printf("Rotor: starting thread\n"); + manager.start(new Rotor::Render_context(sID)); content=""+sID+"\n"; } else if (command[0]=="list") { - for (std::unordered_map::iterator it = context.begin(); it != context.end(); ++it) { - content+=""+it->first+"\n"; + std::list < Poco::AutoPtr < Poco::Task > >::iterator it; + it=manager.taskList().begin(); + for (it=manager.taskList().begin();it !=manager.taskList().end();++it) { + content+=""+(*it)->name()+"\n"; } } else { -- cgit v1.2.3