mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user