| | |
| | | |
| | | #include "util.h" |
| | | |
| | | struct s1000 { char a[1000]; }; |
| | | |
| | | struct s1000 { |
| | | char a[1000]; |
| | | }; |
| | | |
| | | BOOST_AUTO_TEST_CASE(BasicTest) |
| | | { |
| | |
| | | BOOST_CHECK(!p); |
| | | BOOST_CHECK(p.get() == 0); |
| | | |
| | | |
| | | auto init_avail = Avail(); |
| | | |
| | | auto BasicTest = [&](int tid, int nloop) { |
| | | auto Code = [&](int id) { |
| | | |
| | | typedef ShmObject<s1000> Int; |
| | | std::string name = std::to_string(id); |
| | | auto a0 = Avail(); |
| | |
| | | ThreadManager threads; |
| | | int nthread = 1; |
| | | int nloop = 1; |
| | | for (int i = 0; i < nthread; ++i) |
| | | { |
| | | for (int i = 0; i < nthread; ++i) { |
| | | threads.Launch(BasicTest, i, nloop); |
| | | } |
| | | BOOST_CHECK_EQUAL(init_avail, Avail()); |
| | |
| | | BOOST_CHECK_EQUAL(m1.Release(shm), 0); |
| | | BOOST_CHECK(!m1.IsCounted()); |
| | | } |
| | | |