I'm using Xenomai version 2.4. -----Original Message----- From: Gilles Chanteperdrix [mailto:[email protected]] Sent: Tuesday, June 30, 2009 10:53 AM To: Landau, Bracha Cc: [email protected] Subject: Re: [Xenomai-help] pthread_mutex_lock returns 1
Landau, Bracha wrote: > Thanks for your help. > > I tried to put in "printk"s in the kernel implementation of the > xenomai pthread_mutex_lock, and it did not work. Neither did xnprintf. > I did this in order to find out what is the exact cause of the error; > generally adding printk's in the kernel implementation of functions > did work, but on this one it didn't. > > Is there any way to discern what exactly the problem is? This code was > working on earlier versions of Xenomai (2.2) and did not generate an > error on this instance of calling pthread_mutex_lock. Either your mutex is not process-shared and you try to use it from a different process (if that is the case, that is easy to know, you did not call pthread_mutexattr_setpshared, and you try to access the mutex from a different process, because you called fork after pthread_mutex_init for instance, see http://www.xenomai.org/index.php/Porting_POSIX_applications_to_Xenomai#Mixing_fork_with_Xenomai_POSIX_skin_services. ) Or you are trying to lock the mutex from a thread which is not a Xenomai thread (that is, a thread created with __real_pthread_create, or in some part of the code where pthread_create is not wrapped with Xenomai POSIX skin's compilation flags). You do not tell us with what version of Xenomai you have the problem. If this is 2.5-rc2, it is normal that you do not see your printks: the mutexes fast path is now handled in user-space (so, now that you mention it, I wonder if the pshared attribute works, so, you may have pthread_mutex_lock which does not fail when it is handled in user-space, and which fails when it has to go through kernel-space). > This e-mail is confidential, the property of NDS Ltd and intended for > the addressee only. Any dissemination, copying or distribution of this > message or any attachments by anyone other than the intended recipient > is strictly prohibited. Please be informed that since you send this mail to a public mailing list, we cannot fulfil these requirements in any other way than by preventing you from posting to the list. -- Gilles This e-mail is confidential, the property of NDS Ltd and intended for the addressee only. Any dissemination, copying or distribution of this message or any attachments by anyone other than the intended recipient is strictly prohibited. If you have received this message in error, please immediately notify the [email protected] and destroy the original message. Messages sent to and from NDS may be monitored. NDS cannot guarantee any message delivery method is secure or error-free. Information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. We do not accept responsibility for any errors or omissions in this message and/or attachment that arise as a result of transmission. You should carry out your own virus checks before opening any attachment. Any views or opinions presented are solely those of the author and do not necessarily represent those of NDS. To protect the environment please do not print this e-mail unless necessary. NDS Limited Registered Office: One London Road, Staines,Middlesex TW18 4EX, United Kingdom. A company registered in England and Wales Registered no. 3080780 VAT no. GB 603 8808 40-00 _______________________________________________ Xenomai-help mailing list [email protected] https://mail.gna.org/listinfo/xenomai-help
