11 #include <boost/date_time/posix_time/posix_time.hpp>
12 #include <boost/thread/thread.hpp>
16 : buffer_(bufferSize, NULL),
26 for (std::size_t i = 0; i <
buffer_.size(); ++i)
delete buffer_[i];
30 if (
empty())
return false;
33 std::string str =
data->buf.str();
37 for (std::size_t i = 0; i <
outputs_.size(); ++i)
46 return RTLoggerStream(NULL,
oss_);
48 bool alone =
wmutex.try_lock();
52 return RTLoggerStream(NULL,
oss_);
57 data->buf.pubseekpos(0);
59 return RTLoggerStream(
this,
oss_);
91 struct sched_param threadParam;
92 if (pthread_getschedparam(pthread_self(), &threadPolicy, &threadParam) ==
96 if (threadParam.sched_priority < sched_get_priority_min(threadPolicy))
97 threadParam.sched_priority = sched_get_priority_min(threadPolicy);
99 pthread_setschedparam(pthread_self(), threadPolicy, &threadParam);
112 boost::this_thread::sleep(boost::posix_time::milliseconds(1000));