linux native async fix

Pedro Alves pedro@codesourcery.com
Mon Mar 24 17:49:00 GMT 2008


The current code caches pending events in lp->status in some
situations.  This is useful so linux_nat_wait notices an event
we have already waited for, it is handled immediatelly without
waitpid'ing.  It works nicelly in non-async mode, because
target_wait is always called after proceeding the target.
This pending event caching bypasses the event loop, so we can
have the case where an event in one thread goes unnoticed
until some other event happens.  There's code currently that tried
to detected this in linux_nat_resume, and puts an special wake event
token in the event pipe.  This logic is racy and can brake in
several corner case situations, especially with non-stop mode.
Since in async mode we already have a place to cache events, so
we don't really need another.  With this patch, in async
mode, no event is left pending in lp->status.

Tested in sync mode, and async mode all-stop, non-stop
in x86_64-unknown-linux-gnu.

OK?

-- 
Pedro Alves
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linux_async_fixes.diff
Type: text/x-diff
Size: 10169 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20080324/a70a0369/attachment.bin>


More information about the Gdb-patches mailing list