Utility class to temporarily lock stdout or stderr. More...
#include <boost/thread.hpp>
#include <iostream>
Go to the source code of this file.
Classes | |
class | cout_lock< fd > |
Defines | |
#define | L_COUT |
#define | L_CERR |
#define | D_COUT if (0) L_COUT |
Utility class to temporarily lock stdout or stderr.
Definition in file io-lock.h.
#define D_COUT if (0) L_COUT |
#define L_CERR |
for (cout_lock<2> cout_lock_instance; \ cout_lock_instance.stop(); \ cout_lock_instance.incr()) std::cerr
Same as L_COUT, but for cerr
#define L_COUT |
for (cout_lock<1> cout_lock_instance; \ cout_lock_instance.stop(); \ cout_lock_instance.incr()) std::cout
Use for variable scope to hold the mutex for a single line.
Usage: L_COUT << "foo" << bar << endl;