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__);
> 

A question that may look stupid, is ob->rt_lock correctly initialised?
Also, why using a malloc for this, why not doing:

typedef struct object {
   RT_MUTEX rt_lock;
   /* ... */
} Object;

int err = rt_mutex_create (&ob->rt_lock, NULL);

err = rt_mutex_acquire (&ob->rt_lock, TM_INFINITE);

> On creation, rt_mutex_create returns 0 (as expected).
> 
> On acquiring, rt_mutex_acquire returns -3,
> 
> 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?

3 is ESRCH, what version of Xenomai are you using?

-- 
                                          Gilles


_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to