[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rtl] task suspended ?
Jan Albiez (albiez@fzi.de) wrote:
> Hoi !
>
> Is there any chance to find out wether a task is suspended with
> pthread_suspend_np ?
>
> My problem is, that I have a queue emptying thread, which sould be suspend
> itself when the queue is empty, and started again for a periodic time until
> the queue ist empty again. The startup should be done from outside the task.
You can use semaphores.
To suspend itself, the thread should
sem_wait(&sem)
To wake the thread up, use sem_post(&sem);
Michael.