]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/smart_ptr/test/lw_thread_test.cpp
1fe2274938605113e5f2955da1e248952d0a3445
4 // Copyright 2018 Peter Dimov
5 // Distributed under the Boost Software License, Version 1.0.
7 #include <boost/detail/lightweight_thread.hpp>
8 #include <boost/detail/lightweight_test.hpp>
9 #include <boost/smart_ptr/detail/atomic_count.hpp>
11 boost::detail::atomic_count
count( 0 );
21 boost::detail::lw_thread_t th
[ N
] = {};
23 for( int i
= 0; i
< N
; ++i
)
25 boost::detail::lw_thread_create( th
[ i
], f
);
28 for( int i
= 0; i
< N
; ++i
)
30 boost::detail::lw_thread_join( th
[ i
] );
33 BOOST_TEST_EQ( count
, N
);
35 return boost::report_errors();