Recognize return codes and display appropriate dialog. Works only if

executable was not found or file is not executable.
Add mutexes since childs return codes comes from second thread. This
will also prevent races when report dialogs are shown.
This commit is contained in:
Sanel Zukan
2007-09-14 12:31:03 +00:00
parent f0e0bc9032
commit 0876c5271d
5 changed files with 50 additions and 5 deletions

View File

@ -18,6 +18,8 @@
#include <edelib/String.h>
#include <FL/x.h>
#include <pthread.h>
struct EvokeClient {
edelib::String desc; // short program description (used in Starting... message)
edelib::String icon; // icon for this client
@ -90,4 +92,20 @@ class EvokeService {
#define EVOKE_LOG EvokeService::instance()->log()->printf
/*
* FIXME: This should be probably declared somewhere outside
* or in edelib as separate class
*/
class Mutex {
private:
pthread_mutex_t mutex;
Mutex(const Mutex&);
Mutex& operator=(const Mutex&);
public:
Mutex() { pthread_mutex_init(&mutex, 0); }
~Mutex() { pthread_mutex_destroy(&mutex); }
void lock(void) { pthread_mutex_lock(&mutex); }
void unlock(void) { pthread_mutex_unlock(&mutex); }
};
#endif