The thread is created using the following statement.
Code:
my_ret = pthread_create( &my_thread, NULL, thread_is_prime, &my_param);
I tried stopping it with:
Code:
pthread_kill(my_thread, SIGSTOP);
But that causes main() to exit also.
The thread is not joined to the main thread using thread_join().
I read about the sigpending function in the manual pages, and it seems that i should try to use it to catch the signal sent by the main thread, and call thread_exit(), BUT the pages state that the sigpending function will make the thread wait for the signal flags of it's parameters to be set, which is not what i want i think.
Any suggestions? I haven't tried concurrent programming before, but it seems like a very powerful way to code, and i would like to get started.