-- On Thu, 4 Oct 2007, Morten Mossige wrote: > Hi > I'm porting an application from another realtime-os to Linux. This > application makes use of intLock() from time to time. I still need the the > application to be compilable on both Linux and my old os, so I need a > portabel intLock() > I have tried the following approach: > When a thread needs to do intLock, I boost the thread-pri to max, and when > the thread does intUnLock() I set the thread-pri back. This woorks quite ok, > but by using this approach, I will also lock other threads in other > applications running on Linux. > What I really need is a way of blocking all other threads in my application, > without affecting other applications. > I know I can use mutex'es and semaphores, but that will require a major > rewriting of the application, and that is somthing I dont want to do. > Can someone come up with an idea how this is done best? > Morten Upping the prio is basically what intLock does really. That is upping it over the priority of interrupts, which would also mean that you would not be preempted. So by increasing the prio to max, you have in essence locked out all interrupts from that CPU, as well as other tasks. So just doing for you application doesn't make sense. Note, the timer interrupt will still go off. Without knowing more about you application, we really cant give much more advice. - To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html