
30 Aug
2008
30 Aug
'08
12:15 p.m.
I see the run() method running in a loop. Then how do I stop the service from some other thread?.
Any help would be greatly appreciated.
Arrange for a way for another thread can call top() on the first thread's io_service object.
stop() sends a signal to end a threads execution of run(), so it's as simple as another thread holding a reference to io_service and invoking when required.