nasa/osal — pull request #3 by tinti (2013-07-24 13:00:14+00:00)
Title: Pull request partial deadlock fix

The OSAL api uses a global lock to perform some operations using mutex,
semaphores, queues and so. This leads to a possible deadlock in the program
due the following situation.

Let "I" be the timer interrupt (SIG63):

|[Thread 1]
| ...
| call OS_TaskGetInfo
| ...
| lock(global)
| ...
I----+--------------------+
|[Interrupt]
| ...
| call OS_TaskGetInfo
| ...
| lock(global) // DEADLOCK

There are some possible solutions to avoid this problem. One is to never use any
OSAL primitives on the interrupt context, which quite limit the library. Other
would be block all signals during the global lock and let them be pending. This
approach may introduce poor performance. Other would be find out how to remove
these global locks. Another could be use safe locks on interrupt handler.

This patch implements the blocking signals solution because it is the best
trade-off of the current solutions.