merge the trunk with the development of ZeroMQ branch

git-svn-id: https://subversion.gsi.de/fairroot/fairbase/trunk@22451 0381ead4-6506-0410-b988-94b70fbc4730
This commit is contained in:
Mohammad Al-Turany
2013-10-25 12:42:48 +00:00
parent d65d7e490f
commit 5121fe3ae5
36 changed files with 1291 additions and 727 deletions

View File

@@ -5,6 +5,11 @@
* Author: dklein
*/
#include <iostream>
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include "FairMQSink.h"
#include "FairMQLogger.h"
@@ -17,25 +22,25 @@ void FairMQSink::Run()
void* status; //necessary for pthread_join
FairMQLogger::GetInstance()->Log(FairMQLogger::INFO, ">>>>>>> Run <<<<<<<");
pthread_t logger;
pthread_create(&logger, NULL, &FairMQDevice::callLogSocketRates, this);
boost::thread rateLogger(boost::bind(&FairMQDevice::LogSocketRates, this));
// Initialize poll set
zmq_pollitem_t items[] = {
{ *(fPayloadInputs->at(0)->GetSocket()), 0, ZMQ_POLLIN, 0 }
};
while (true) {
while ( fState == RUNNING ) {
FairMQMessage msg;
zmq_poll(items, 1, -1);
zmq_poll(items, 1, 100);
if (items[0].revents & ZMQ_POLLIN) {
fPayloadInputs->at(0)->Receive(&msg);
}
}
pthread_join(logger, &status);
rateLogger.interrupt();
rateLogger.join();
}
FairMQSink::~FairMQSink()