67void LimitedWarning::warn(
const char * warning, std::ostream * ostr) {
69 if (((LimitedWarning::Summary *)_this_warning_summary) == 0){
70#ifdef FASTJET_HAVE_LIMITED_THREAD_SAFETY
79 std::lock_guard<std::mutex> guard(_global_warnings_summary_mutex);
84 if (((LimitedWarning::Summary *)_this_warning_summary) == 0){
86 _global_warnings_summary.push_back(Summary(warning, 0));
87 _this_warning_summary = & (_global_warnings_summary.back());
92 _global_warnings_summary.push_back(Summary(warning, 0));
93 _this_warning_summary = & (_global_warnings_summary.back());
99 unsigned int count = (*_this_warning_summary).second.step();
102 if ((_max_warn<0) || (count < (
unsigned int)_max_warn)) {
104 ostringstream warnstr;
105 warnstr <<
"WARNING from FastJet: ";
107 if ((_max_warn>0) && (count+1 == (
unsigned int)_max_warn))
108 warnstr <<
" (LAST SUCH WARNING)";
109 warnstr << std::endl;
115#ifdef FASTJET_HAVE_LIMITED_THREAD_SAFETY
117 std::lock_guard<std::mutex> guard(*_stream_mutex);
118 (*ostr) << warnstr.str();
123 (*ostr) << warnstr.str();