Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00014 #include "utils/io-lock.h"
00015 #include <boost/thread.hpp>
00016
00017 template<typename T>
00018 T delay(T v, int t) {
00019 usleep(t);
00020 return v;
00021 }
00022
00023 void f() {
00024 L_COUT << "Start " << delay("middle ", 1000) << delay(42, 1000) << " end." << std::endl;
00025 }
00026
00027 int main() {
00028 boost::thread t1(f);
00029 boost::thread t2(f);
00030 boost::thread t3(f);
00031 boost::thread t4(f);
00032 t1.join();
00033 t2.join();
00034 t3.join();
00035 t4.join();
00036 }