|
Boost Users : |
Subject: Re: [Boost-users] [ASIO] Where to use CoInitizeEx
From: Igor R (boost.lists_at_[hidden])
Date: 2009-06-03 09:42:06
> void io_worker_thread(void)
> {
> #if (WIN32)
> Â CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
> #endif
>
> Â io_service.run();
>
> #if (WIN32)
> Â CoUninitialize();
> #endif
> };
>
> EXTERN_C EUROATLIB_API TETRAMotoHndl CALL GetTETRAMotoObj()
> {
> Â ....
> Â // run the IO service as a separate thread
>
> Â //io_service_thread.reset(
> Â // Â new boost::thread(
> Â // Â Â boost::bind(&boost::asio::io_service::run, &io_service)
> Â // Â )
> Â //);
>
> Â io_service_thread.reset(new boost::thread(io_worker_thread));
>
> Â ...
> };
You forgot you to pass the io_service to the io_worker_thread.
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