Problem using rt_sem_wait

Jorge Almeida j-almeida at criticalsoftware.com
Mon Jan 23 19:40:30 CET 2006


Hi Thomas.

I'm not using that flag.
Its the default optimization from GCC. I think is -O0, or no optimization.


Em Monday 23 January 2006 17:34, escreveu:
> Out of curiosity, what are your compile options?
>
> I noticed that I got a lot of null pointers when I compiled with "-O3";
> "-O2" was as optimized as I could go.
>
> F. Thomas
>
> > -----Original Message-----
> > From: rtai-admin at rtai.org [mailto:rtai-admin at rtai.org] On Behalf Of Jorge
> > Almeida
> > Sent: Monday, January 23, 2006 9:37 AM
> > To: rtai at rtai.org
> > Cc: Hannes Mayer; Suessmilch Bernd
> > Subject: Re: Problem using rt_sem_wait
> >
> >
> >
> > No my task pointer is not NULL.
> > I've already check that several times.
> > Even in the place where i call the rt_sem_wait.
> >
> > With this constructor:
> >
> > Debug::Debug(): QThread(),
> > 	m_psTask(NULL)
> > {
> >
> >     //initializes the task for this thread
> >     if(m_psTask == NULL){
> >         m_psTask = rt_task_init(rt_get_name(0),0,0,0);
> >     }
> >    printf("Debug task pointer = %p\n",m_psTask);
> >    fflush(stdout);
> > }
> >
> > I get for the task pointer the following result:
> >
> > "Debug task pointer = 0xe123f220"
> >
> > the function "rt_get_name(0)" permits obtaining a name that isn't
> > registered
> > in the RTAI Domain. This is usefull while the program is in fase of debug
> > because if it crashs we do not need to make a reboot to the computer to
> > use
> > the same name. If the program crashs the name is not deleted from the
> > RTAI names.
> >
> > Thanks
> >
> > Em Monday 23 January 2006 14:19, o Hannes Mayer escreveu:
> > > Jorge Almeida wrote:
> > > > Yes.
> > > > I'm using C++ and i call rt_task_init in the class constructor.
> > > >
> > > >
> > > > Debug::Debug(): QThread(),
> > > > 	m_psTask(NULL)
> > > > {
> > > >
> > > >     //initializes the task for this thread
> > > >     if(m_psTask == NULL){
> > > >         m_psTask = rt_task_init(rt_get_name(0),0,0,0);
> > > >     }
> > > > }
> > >
> > > Dunno if that is related to your problem, but I always use
> > > nam2num() to provide the task name e.g. nam2num("MAIN").
> > >  From the docs: rt_get_name: Get an object name by its address
> > > Do you check m_psTask after rt_task_init ?
> > > I bet it's NULL.
> > >
> > > Best regards,
> > > Hannes.
> >
> > --
> > Jorge Almeida
> > j-almeida at criticalsoftware.com
> >
> >
> >
> > DISCLAIMER: This message may contain confidential information or
> > privileged material and is intended only for the individual(s) named. If
> > you are not a named addressee and mistakenly received this message you
> > should not copy or otherwise disseminate it: please delete this e-mail
> > from your system and notify the sender immediately. E-mail transmissions
> > are not guaranteed to be secure or error-free as information could be
> > intercepted, corrupted, lost, destroyed, arrive late or incomplete or
> > contain viruses. Therefore, the sender does not accept liability for any
> > errors or omissions in the contents of this message that arise as a
> > result of e-mail transmissions. Please request a hard copy version if
> > verification is required. Critical Software.

-- 
Jorge Almeida
j-almeida at criticalsoftware.com



DISCLAIMER: This message may contain confidential information or privileged material and is intended only for the individual(s) named. If you are not a named addressee and mistakenly received this message you should not copy or otherwise disseminate it: please delete this e-mail from your system and notify the sender immediately. E-mail transmissions are not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete or contain viruses. Therefore, the sender does not accept liability for any errors or omissions in the contents of this message that arise as a result of e-mail transmissions. Please request a hard copy version if verification is required. Critical Software.




More information about the Rtai mailing list