]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/filesystem/test/issues/11166-remove-race.cpp
1 #include <boost/filesystem.hpp>
2 #include <boost/thread.hpp>
5 boost::condition_variable cond
;
8 #define FNAME ("remove-test")
13 boost::filesystem::remove(FNAME
);
19 for (int i
= 0; i
< 100000; i
++)
20 std::fstream(FNAME
, std::fstream::out
);
25 boost::filesystem::remove(FNAME
);
26 boost::filesystem::remove(FNAME
);
28 std::cout
<< "If you got this far, it's OK to remove a file that doesn't exist\n"
29 "Now trying with one creator thread and two remover threads.\n"
30 "This is likely to crash after just a few seconds at most."
33 boost::thread
c(creater
), r1(remover
), r2(remover
);