Hi,

I have some problems with POSIX thread API. I have to implement function that suspends a thread.
I have a structure of Thread with one pthread_t and some other stuff. I have also put one pthread_mutex and one pthread_cond in this structure to implement suspend. I use the condition variable to block on it the suspended thread and the mutex for syncronization with the thread that suspeds the target thread. My problem is that the function that I should implement has the thread that should be suspended as a parameter. I hava the following prototype:
void ThreadSuspend(Thread* thread);
After this function the "thread" parameter should be suspended. But the problem is how block this thread through the thread that executes this function. How to invoke pthread_cond_wait() or pthread_mutex_lock for the given as a parameter thread in the body of the function?

Thank you in advance.

--Nayden