what not should be done when implementing an interrupt?
Sigiloso
What should not be done is probably acquire a mutex (use spin-lock instead). When a thread tries to acquire a mutex and if it does not succeed, either due to another thread having already acquired it or due to a context switch, the thread goes to sleep until been woken-up which is critical if used in an ISR. Whereas when a thread fails to acquire a spin-lock, it continuously tries to acquire it, until it finally succeeds, thus avoiding sleeping in an ISR. Using spin-locks in the "top-half" is a common practice followed in writing Linux Device Driver Interrupt handlers.