]>
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
++) std::fstream(FNAME
, std::fstream::out
);
24 boost::filesystem::remove(FNAME
);
25 boost::filesystem::remove(FNAME
);
28 "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
);
36 r1
.interrupt(); r1
.join();
37 r2
.interrupt(); r2
.join();