Boost logo

Boost Users :

Subject: Re: [Boost-users] how to free thread object
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-10-09 22:07:11


AMDG

On 10/09/2011 06:20 PM, davieyan wrote:
> Hi,
> I write code to start a thread,but how to free this thread.

What do you mean by freeing the thread?
The thread object is destroyed when it goes out
of scope, like any other object created
on the stack.

> code:
>
> void helloworld()
> {
> std::cout << "Hello World!" << std::endl;
> }
>
> int main()
> {
> boost::thread thrd(&helloworld);
> thrd.join();
> }
>

In Christ,
Steven Watanabe




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net