0

I am using gdb, and something like following:

thread_2()
{
    // do something
    wait_thread_1_to_wake_me_up();
    // do something
}

thread_1()
{
    // do something
    create_thread_2();

    // do something
    wake_thread_2_up();

    // do something
    join();
}

my problem is when I am using gdb and set scheduler-locking on, if my current thread is thread_2, when it's hanging up by wait_thread_1_to_wake_me_up(), how could I now switch to thread_1?

Because current thread is thread_2 and it's hanging up, I can't input anything like ``thread 1".

It's really annoying for me, anybody who know how to do that? Or some other smart ideas to get rid of it?

Thanks so much!

  • Why you can't? Push Ctrl+C and make it current: `thread 1`. – ks1322 Nov 17 '15 at 11:30
  • to ks1322: I tried that but, I don't know whether pressing ctrl+c will change something for the program, something that disturb the current logic. – user1490269 Nov 17 '15 at 18:23
  • I think it has something to do with the kind of operation you are doing: what kind of treatment "hangs"? Looks like the kernel does not give you the hand for some reason... – OznOg Nov 20 '15 at 19:05

0 Answers0