2008-09-05 Joel Sherrill <joel.sherrill@oarcorp.com>

* shmsupp/lock.c: Disable CPU interrupts when we have the shared memory
	locked. This is necessary to prevent deadlock.
This commit is contained in:
Joel Sherrill
2008-09-05 21:33:41 +00:00
parent 538583f5b1
commit 252dea2fa1
2 changed files with 11 additions and 2 deletions

View File

@@ -1,3 +1,8 @@
2008-09-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* shmsupp/lock.c: Disable CPU interrupts when we have the shared memory
locked. This is necessary to prevent deadlock.
2008-09-05 Joel Sherrill <joel.sherrill@oarcorp.com> 2008-09-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, preinstall.am, shmsupp/getcfg.c, shmsupp/lock.c, * Makefile.am, preinstall.am, shmsupp/getcfg.c, shmsupp/lock.c,

View File

@@ -41,10 +41,13 @@ void Shm_Initialize_lock(
* a deadlock condition. * a deadlock condition.
*/ */
static rtems_interrupt_level level;
void Shm_Lock( void Shm_Lock(
Shm_Locked_queue_Control *lq_cb Shm_Locked_queue_Control *lq_cb
) )
{ {
rtems_interrupt_disable( level );
(void) PSIM.Semaphore.lock; (void) PSIM.Semaphore.lock;
} }
@@ -59,4 +62,5 @@ void Shm_Unlock(
) )
{ {
(void) PSIM.Semaphore.unlock; (void) PSIM.Semaphore.unlock;
rtems_interrupt_enable( level );
} }