*/
#include <stdlib.h> // for system
-#include <sys/types.h> // for stat, getpid
-#include <sys/stat.h> // fot stat, chmod
+#include <sys/types.h> // for stat, getpid
+#include <sys/stat.h> // fot stat, chmod
#include <unistd.h> // fot stat, getpid
-#include <sys/shm.h> // for shmget, shmat
+#include <sys/shm.h> // for shmget, shmat
+#include <pthread.h> // for mutex
#include <X11/Xlib.h>
#include <X11/Xutil.h>
screenshot_data sdata;
probeInfo_t probeInfo;
int ret = 0;
+ static pthread_mutex_t captureScreenLock = PTHREAD_MUTEX_INITIALIZER;
+
+ pthread_mutex_lock(&captureScreenLock);
probeBlockStart();
probeBlockEnd();
+ pthread_mutex_unlock(&captureScreenLock);
return ret;
}
log.data[log.length] = '\0';
- if(log.type == MSG_CONFIG)
- {
+ if (log.type == MSG_CAPTURE_SCREEN) {
+ captureScreen();
+ } else if (log.type == MSG_CONFIG) {
_configure(log.data);
}
else if(log.type == MSG_STOP)