This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: AW: Blocking restricted in DSRs
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: "Neundorf, Alexander" <Alexander dot Neundorf at jenoptik dot com>
- Cc: <ecos-discuss at sources dot redhat dot com>
- Date: 27 Jul 2004 17:48:32 +0100
- Subject: Re: AW: [ECOS] Blocking restricted in DSRs
- References: <5A8A17126B73AC4C83968F6C4505E3C5E3EF99@JO-EX01.JENOPTIK.NET>
"Neundorf, Alexander" <Alexander.Neundorf@jenoptik.com> writes:
> ...
> > Threads can call blocking functions with the scheduler locked. The
> > lock is essentially a per-thread variable so when the thread is
> > resumed the lock is returned to its former value.
>
> IOW cyg_scheduler_lock() ensures that the scheduler doesn't run as
> long as the thread which called cyg_scheduler_lock() doesn't call a
> synchronization function which calls itself the scheduler, right ?
>
Correct.
> But still I don't understand the code. cyg_scheduler_lock() calls
> Cyg_Scheduler::lock() in sched.inl, which calls
> inc_sched_lock(). This I find in smp.hxx. I don't see any thread
> specific data there, so how can this act thread-specific ?
The next lock value is passed as an argument to unlock_inner() and is
therefore saved across the context switch on the stack and set when
then thread is rescheduled. That is why I said "essentially", since it
is not stored explicitly in the thread object.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss