core spinlock wait returns immediately

Gedare Bloom gedare at rtems.org
Thu Oct 11 13:58:01 UTC 2012


Is the spinlock already locked? if not it would return immediately

Did the thread that's attempting to gain the lock previuosly lock it?
if so it would return immediately

-Gedare

On Wed, Oct 10, 2012 at 11:59 PM, Andrei Dimitrief-Jianu
<andrei.dimitrief.jianu at gmail.com> wrote:
> Hello,
>
> I initialize a core spinlock using the code below:
>
>   CORE_spinlock_Attributes spinlock_attributes;
>   spinlock_attributes.XXX = 0;
>   _CORE_spinlock_Initialize( &spinlock, &spinlock_attributes );
>
> When calling wait() on the same spinlock from a worker task using the
> code below, the task returns w/o waiting for the spinlock to be
> released.
>
>   CORE_spinlock_Status spinlock_status;
>   spinlock_status = _CORE_spinlock_Wait( &spinlock, true, 0 );
>
>
> Anything that is obvious that I am doing wrong?
>
> Thanks!
> _______________________________________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-devel



More information about the devel mailing list