Am 07.03.10 16:35, schrieb Jan Engelhardt:
So you replaced the old DECLARE_MUTEX() (which is actually a binary semaphore as Jean mentioned) with struct semaphore. Which is not wrong, of course. But it shows that the semaphore was used as mutex, so I don't see a problem with using the new Mutex API as Jean mentioned.
You would have to check whether the sema is held in sleeping, which newmutexes are not allowed to.
include/linux/semaphore.h: #define DECLARE_MUTEX(name) \ struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1) So the initial mutex you want to replace is a semaphore. Just the macros are missing in RT. Okay. include/linux/mutex.h: #define DEFINE_MUTEX(mutexname) \ struct mutex mutexname = __MUTEX_INITIALIZER(mutexname) Okay, Jean was proposing a 'struct mutex'. I was not talking about a rt_mutex (the spinlock replacement). If there's a 3rd mutex flavour ('newmutex') I'm not aware of, please enlight me. Even the RT patch itself does -static DECLARE_MUTEX(console_sem); +static DEFINE_MUTEX(console_mutex); I would wonder if that mutex wouldn't be held while a task sleeps. Regards, Bernhard -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org