summaryrefslogtreecommitdiffstats
path: root/src/Daemon
diff options
context:
space:
mode:
Diffstat (limited to 'src/Daemon')
-rw-r--r--src/Daemon/CommLayerServer.h1
-rw-r--r--src/Daemon/CommLayerServerDBus.cpp9
-rw-r--r--src/Daemon/CommLayerServerDBus.h2
-rw-r--r--src/Daemon/CrashWatcher.cpp13
4 files changed, 13 insertions, 12 deletions
diff --git a/src/Daemon/CommLayerServer.h b/src/Daemon/CommLayerServer.h
index ededee5..3a1177d 100644
--- a/src/Daemon/CommLayerServer.h
+++ b/src/Daemon/CommLayerServer.h
@@ -17,6 +17,7 @@ class CCommLayerServer {
virtual void Update(const std::string& pMessage, uint64_t pJobID) {};
virtual void Warning(const std::string& pMessage) {};
virtual void JobDone(const std::string &pDest, uint64_t pJobID) {};
+ virtual void JobStarted(const std::string &pDest, uint64_t pJobID) {};
virtual void Warning(const std::string& pMessage, uint64_t pJobID) {};
};
diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp
index d3e157d..8077757 100644
--- a/src/Daemon/CommLayerServerDBus.cpp
+++ b/src/Daemon/CommLayerServerDBus.cpp
@@ -230,6 +230,15 @@ void CCommLayerServerDBus::JobDone(const std::string &pDest, uint64_t job_id)
emit_signal(sig);
}
+void CCommLayerServerDBus::JobStarted(const std::string &pDest, uint64_t job_id)
+{
+ ::DBus::SignalMessage sig("JobStarted");
+ ::DBus::MessageIter wi = sig.writer();
+ wi << pDest;
+ wi << job_id;
+ emit_signal(sig);
+}
+
void CCommLayerServerDBus::Error(const std::string& arg1)
{
::DBus::SignalMessage sig("Error");
diff --git a/src/Daemon/CommLayerServerDBus.h b/src/Daemon/CommLayerServerDBus.h
index a3b54a7..eda2196 100644
--- a/src/Daemon/CommLayerServerDBus.h
+++ b/src/Daemon/CommLayerServerDBus.h
@@ -38,7 +38,9 @@ class CCommLayerServerDBus
virtual void AnalyzeComplete(const map_crash_report_t& arg1);
virtual void Error(const std::string& arg1);
virtual void Update(const std::string& pMessage, uint64_t pJobID);
+ //the job id should be enough in jobdone
virtual void JobDone(const std::string& pDest, uint64_t pJobID);
+ virtual void JobStarted(const std::string& pDest, uint64_t pJobID);
virtual void Warning(const std::string& pMessage);
virtual void Warning(const std::string& pMessage, uint64_t pJobID);
};
diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp
index 2713179..288ecc0 100644
--- a/src/Daemon/CrashWatcher.cpp
+++ b/src/Daemon/CrashWatcher.cpp
@@ -119,18 +119,7 @@ static void *create_report(void *arg)
thread_data_t *thread_data = (thread_data_t *) arg;
map_crash_info_t crashReport;
- /* Ugly hack.
- * We use DBus signals to talk to clients.
- * If the report thread emits a signal with embedded job id before
- * main thread returns this job id as a CreateReport() DBus call's
- * return value, the client will not be able to understand
- * that this signal is for its job.
- * By no means this is the right solution. The right one would be
- * to ensure that CreateReport() DBus call returns _before_
- * we continue here. This will need substantial surgery
- * on our DBus machinery. TODO.
- */
- usleep(10*1000);
+ g_pCommLayer->JobStarted(thread_data->dest, thread_data->thread_id);
log("Creating report...");
try