Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AsioService.cpp miscounts running Threads #129

Open
jipsina opened this issue Jul 7, 2015 · 0 comments
Open

AsioService.cpp miscounts running Threads #129

jipsina opened this issue Jul 7, 2015 · 0 comments

Comments

@jipsina
Copy link

jipsina commented Jul 7, 2015

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_;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant