This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: cyg_thread_resume question
- From: Reji P Rajesh <rejip at cdotb dot ernet dot in>
- To: mohanlal jangir <mohanlaljangir at hotmail dot com>
- Cc: mailing-list ecos <ecos-discuss at sources dot redhat dot com>
- Date: Thu, 3 Jul 2003 13:25:33 +0500 (GMT+0500)
- Subject: Re: [ECOS] cyg_thread_resume question
Hi,
Cyg_Thread::suspend_count will never become negative. Because if
Cyg_Thread::suspend_count is greater than zero only,
Cyg_Thread::resume will decrement Cyg_Thread::suspend_count.
reji
On Thu, 3 Jul 2003, mohanlal jangir wrote:
> I have a question regarding following lines from eCos reference guide:
> "cyg_thread_suspend can be used to increment the suspend counter, and
> cyg_thread_resume decrements it. The scheduler will never run a thread with
> a non-zero suspend counter"
>
> Does it mean that resuming a thread without varify if it is sleeping or not
> can lead the thread to be non-runnable? For example a thread X is in ready
> state but not getting executed because some higher priority thread Y is
> running. Now thread Y calls cyg_thread_resume(X). This will decrement the
> suspend counter of thread X, which was already zero. Will the thread X now
> ever run?
>
> Regards
> Mohanlal
>
> --
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>
>
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss