1 2 // Copyright 2017, 2018 Peter Dimov. 3 // 4 // Distributed under the Boost Software License, Version 1.0. 5 // 6 // See accompanying file LICENSE_1_0.txt or copy at 7 // http://www.boost.org/LICENSE_1_0.txt 8 9 #include <boost/thread.hpp> 10 #include <boost/core/lightweight_test.hpp> 11 f(int & x,int y)12void f( int & x, int y ) 13 { 14 x = y; 15 } 16 main()17int main() 18 { 19 int x = 0; 20 21 boost::thread th( f, boost::ref( x ), 12 ); 22 th.join(); 23 24 BOOST_TEST_EQ( x, 12 ); 25 26 return boost::report_errors(); 27 } 28