diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2008-12-26 01:46:48 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2008-12-26 01:46:48 +0100 |
commit | 2ab1fbd763ad8692ea3ca29705a4fe821ccb1309 (patch) | |
tree | e05b4e7925e610e68230e418c99c7b5f520a2d93 /src/modules/SystemBackendPosix.cpp | |
parent | 5e8b56644fa132287431cb06717cdfe0ea05dfbc (diff) | |
download | mad-2ab1fbd763ad8692ea3ca29705a4fe821ccb1309.tar mad-2ab1fbd763ad8692ea3ca29705a4fe821ccb1309.zip |
ActionManager fuer bessere Behandlung von Signalen (und Threads) hinzugefuegt
Diffstat (limited to 'src/modules/SystemBackendPosix.cpp')
-rw-r--r-- | src/modules/SystemBackendPosix.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/modules/SystemBackendPosix.cpp b/src/modules/SystemBackendPosix.cpp index d34b2c8..c8135a3 100644 --- a/src/modules/SystemBackendPosix.cpp +++ b/src/modules/SystemBackendPosix.cpp @@ -20,6 +20,7 @@ #include "SystemBackendPosix.h" #include <Net/FdManager.h> +#include <Common/ActionManager.h> #include <cstdio> #include <cstdlib> @@ -113,13 +114,11 @@ void SystemBackendPosix::childHandler(int) { int status; pid_t pid; - // TODO Don't call callbacks directly - while((pid = waitpid(-1, &status, WNOHANG)) > 0) { std::map<pid_t, sigc::slot<void, int> >::iterator it = processes.find(pid); if(it != processes.end()) { - it->second(status); + Common::ActionManager::get()->add(sigc::bind(it->second, status)); processes.erase(it); } else { @@ -137,7 +136,7 @@ void SystemBackendPosix::childHandler(int) { Net::FdManager::get()->unregisterFd(handle); close(handle); - it2->second(status, output); + Common::ActionManager::get()->add(sigc::bind(it2->second, status, output)); processesWithOutput.erase(it2); processesWOHandles.erase(pid); processesWOOutput.erase(pid); |