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
cond_signal does not wake up a thread #12316
Comments
From matti.linnanvuori@portalify.comCreated by matti@portalify.comcond_signal does not wake another thread up even though I think it should. 8/2/12 12:19:01.930 PM aplicom: Failed to receive data from the socket: Interrupted system call sub post { my $ua = LWP::UserAgent->new; while ($run) { if ( $response->is_success ) { until ( $thread = threads->create('post') or not $run ) { if ( defined $thread ) { syslog LOG_NOTICE, "Locking to signal termination"; if ( defined $thread ) { GNU gdb 6.3.50-20050815 (Apple version gdb-1752) (Sat Jan 28 03:02:46 UTC 2012) Perl Info
|
From mattilinnanvuori@yahoo.comThis a deadlock because the killing thread holds a lock while joining. |
From [Unknown Contact. See original ticket]This a deadlock because the killing thread holds a lock while joining. |
From @iabynOn Thu, Aug 02, 2012 at 02:36:34AM -0700, Matti Linnanvuori wrote:
Its difficult to say for certain, since you don't provide complete code,
You don't unlock %location before trying to join the thread. Note that So you probably need to wrap the lock and cond_signal lines above in a As a more general comment, I'd recommend try to avoid using cond_wait and -- |
The RT System itself - Status changed from 'new' to 'open' |
From mattilinnanvuori@yahoo.comThe bug was indeed in that the joining thread held the lock while the thread being joined waited |
From [Unknown Contact. See original ticket]The bug was indeed in that the joining thread held the lock while the thread being joined waited |
From mattilinnanvuori@yahoo.comWhat I meant that if Perl did not emit a warning when calling cond_signal on an unlocked |
From [Unknown Contact. See original ticket]What I meant that if Perl did not emit a warning when calling cond_signal on an unlocked |
From @iabynOn Thu, Aug 02, 2012 at 10:21:24PM -0700, Matti Linnanvuori via RT wrote:
I think you misunderstand. For correct use of cond_signal, you *must* hold * because otherwise you can't be sure that the other thread has yet -- |
From @dcollinsnOn Fri Aug 03 03:09:02 2012, davem wrote:
Closing as not a bug. -- |
From [Unknown Contact. See original ticket]On Fri Aug 03 03:09:02 2012, davem wrote:
Closing as not a bug. -- |
@dcollinsn - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#114378 (status was 'rejected')
Searchable as RT114378$
The text was updated successfully, but these errors were encountered: