quickfast icon indicating copy to clipboard operation
quickfast copied to clipboard

AsioService.cpp miscounts running Threads

Open jipsina opened this issue 10 years ago • 0 comments

In AsioService::run(), sharedRunningThreadCount_ or runningThreadCount_ is incremented based on wther usingSharedService_ or not. But the decrement is always --runningThreadCount_ As a result, a TCPReceiver gets stuck if a connection dies and a new is established, since the service thinks it is multithreading and enables waiting.

To fix:

*** src/Communication/AsioService.cpp 2015-07-07 11:00:08.000000000 -0400 --- src/Communication/AsioService.cpp.orig 2011-05-04 11:00:48.000000000 -0400


*** 128,140 **** // msg2 << '{' << (void *) this << " :: " << (void *) &ioService_ << "} Stopping AsioService thread #" << tc << std::endl; // std::cout << msg2.str();

! if(usingSharedService_) ! { ! --sharedRunningThreadCount_; ! } ! else ! { ! --runningThreadCount_; ! } }

--- 128,133 ---- // msg2 << '{' << (void *) this << " :: " << (void *) &ioService_ << "} Stopping AsioService thread #" << tc << std::endl; // std::cout << msg2.str();

! --runningThreadCount_; }

jipsina avatar Jul 07 '15 19:07 jipsina