From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <49EEF2B8.2090702@domain.hid> Date: Wed, 22 Apr 2009 12:34:32 +0200 From: Roman Pisl MIME-Version: 1.0 References: <49EEE65E.6060308@domain.hid> <49EEE9F1.2000204@domain.hid> In-Reply-To: <49EEE9F1.2000204@domain.hid> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-help] Problem with mutexes in daemon List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gilles Chanteperdrix Cc: xenomai@xenomai.org Gilles Chanteperdrix napsal(a): > Roman Pisl wrote: >> Hello, >> I'm experiencing weird behavior with mutexes in a daemon application. >> After daemon() is called, unnamed mutexes fail on call >> rt_mutex_release() with -EPERM. Everything is ok for named mutexes. >> >> Is there something special with daemon and unnamed mutexes - should all >> have name? Or is it a bug? I'm using kernel 2.6.28 and Xenomai 2.4.6.1. >> >> Example showing this problem is attached. > > Unnamed mutexes are local to a process. Since forking results in a > different process, mutexes are not preserved. > > Yes, Xenomai behaviour is not intuitive, but fixing this requires > internal changes. > I understand, but daemon() is the first call and everything is done in the new forked process. What is the best solution for now? Is everything except unnamed mutexes supposed to work well in daemon or should I cancel the concept of daemon at all? Roman