On Fri, 2009-08-14 at 09:31 +0200, Hans Søndergaard (HSO) wrote:
> I use objects of type:
>
>
>
> typedef struct object {
>
> RT_MUTEX *rt_lock;
>
> ..
>
> } Object;
>
>
>
> int err = rt_mutex_create (ob->rt_lock, NULL);
>
> printf ("[alloc.c]: rt_mutex_create err: %d; #%d \n", err, __LINE__);
>
>
>
> err = rt_mutex_acquire (ob->rt_lock, TM_INFINITE);
>
> printf ("[lock.c]: rt_mutex_acquire, err: %d; #%d \n", err, __LINE__);
>
>
>
> On creation, rt_mutex_create returns 0 (as expected).
>
> On acquiring, rt_mutex_acquire returns -3,
>
-ESRCH. This means that for some reason, the internal handle copied by
rt_mutex_create() to ob->rt_lock could not be found back in the system
registry when calling rt_mutex_acquire().
Any chance ob->rt_lock may have been overwritten, or this mutex deleted
by another thread in the meantime?
In userland, RT_MUTEX is a structure containing an opaque long integer
value. Maybe you could check that value (printf("%ld",
ob->rt_lock.opaque)) right after rt_mutex_create() returns, and just
before rt_mutex_acquire() is invoked.
> but this return value is not included among the possible return values
> in the documentation of Mutex services.
>
>
>
> Could you please explain what this return value -3 means?
>
>
>
> Best regards
>
> Hans So
>
>
>
>
>
>
> _______________________________________________
> Xenomai-help mailing list
> [email protected]
> https://mail.gna.org/listinfo/xenomai-help
--
Philippe.
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help