title: p_thread: exit from multiple threads
body: <p>I created two threads in my program. I wanted to terminate thread_1 inside thread_2 function and vice versa based on flag. I tried exit() and pthread_exit(Thread_id) but it does not work. I wanted to cancel the thread execution by calling pthread_cancel but the problem is that I cannot pass the thread id before pthread_create. Any suggestions ??</p>