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!

3
  • Why you can't? Push Ctrl+C and make it current: thread 1. Commented Nov 17, 2015 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. Commented Nov 17, 2015 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... Commented Nov 20, 2015 at 19:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.