This commit is contained in:
2020-07-16 12:30:30 +02:00
9 changed files with 29 additions and 16 deletions

View File

@ -105,7 +105,5 @@ install(TARGETS slsReceiverShared slsReceiverStatic slsReceiver
PUBLIC_HEADER DESTINATION include)
#install(FILES ${ZMQ_STATIC_ARCHIVE}
#DESTINATION lib)
install(FILES
DESTINATION lib)
install(FILES ${ZMQ_STATIC_ARCHIVE}
DESTINATION lib)

View File

@ -21,7 +21,7 @@
#define FILE_BUFFER_SIZE (16*1024*1024) //16mb
//fifo
#define FIFO_HEADER_NUMBYTES 4
#define FIFO_HEADER_NUMBYTES 8
//hdf5

View File

@ -16,12 +16,13 @@
#include <sys/wait.h> //wait
#include <unistd.h> //usleep
#include <syscall.h>
#include <semaphore.h>
sem_t semaphore;
bool keeprunning;
void sigInterruptHandler(int p){
keeprunning = false;
sem_post(&semaphore);
}
/*
@ -65,7 +66,7 @@ void GetData(char* metadata, char* datapointer, uint32_t datasize, void* p){
int main(int argc, char *argv[]) {
keeprunning = true;
sem_init(&semaphore,1,0);
cprintf(BLUE,"Created [ Tid: %ld ]\n", (long)syscall(SYS_gettid));
// Catch signal SIGINT to close files and call destructors properly
@ -148,8 +149,8 @@ int main(int argc, char *argv[]) {
FILE_LOG(logINFO) << "Ready ... ";
cprintf(RESET, "\n[ Press \'Ctrl+c\' to exit ]\n");
while(keeprunning)
pause();
sem_wait(&semaphore);
sem_destroy(&semaphore);
delete receiver;
cprintf(BLUE,"Exiting [ Tid: %ld ]\n", (long)syscall(SYS_gettid));