• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (C) 2001-2003
2 // William E. Kempf
3 //
4 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
5 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 
7 #include <boost/thread/thread.hpp>
8 #include <iostream>
9 
10 struct helloworld
11 {
helloworldhelloworld12     helloworld(const char* who) : m_who(who) { }
operator ()helloworld13     void operator()()
14     {
15         std::cout << m_who << "says, \"Hello World.\"" << std::endl;
16     }
17     const char* m_who;
18 };
19 
main()20 int main()
21 {
22     boost::thread thrd(helloworld("Bob"));
23     thrd.join();
24 }
25