This is the mail archive of the
mailing list for the GDB project.
Re: [patch] Fix for PR gdb/10757
On Mon, Oct 26, 2009 at 2:35 PM, Pedro Alves <email@example.com> wrote:
> On Monday 26 October 2009 21:25:39, Paul Pluzhnikov wrote:
>> I wonder if it *could* take some lock that would make all other threads
> the problem with that is that gdb can stop all threads while one
> of them is holding the lock --- you'd have to consider
> the possibility of gdb deadlocking.
I was thinking along the lines of
static __volatile__ int thread_iteration_in_progress;
static __volatile__ int thread_creation_in_progress;
while (thread_iteration_in_progress) nanoslep ...;
... create new thread, put it on thread list ...
set thread_iteration_in_progress in the inferior to 1
while (thread_creation_in_progress in inferior > 0)
iterate over the thread lists ...
set thread_iteration_in_progress in inferior to 0
I think some variant of this could work, but I have no hopes this will
actually get into glibc.