diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-05-02 14:27:24 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-05-19 12:00:47 +0200 |
commit | 4438ac2575fb9e0760bf53931a52d00dec4deb83 (patch) | |
tree | 1a81aa76215e781bdddd08a92f4be01454d330ae /cpukit/libnetworking | |
parent | score: Inline _CORE_semaphore_Surrender() (diff) | |
download | rtems-4438ac2575fb9e0760bf53931a52d00dec4deb83.tar.bz2 |
score: Fine grained locking for mutexes
Update #2273.
Diffstat (limited to 'cpukit/libnetworking')
-rw-r--r-- | cpukit/libnetworking/rtems/rtems_glue.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/cpukit/libnetworking/rtems/rtems_glue.c b/cpukit/libnetworking/rtems/rtems_glue.c index 63d4b8045f..e43dc6e1dc 100644 --- a/cpukit/libnetworking/rtems/rtems_glue.c +++ b/cpukit/libnetworking/rtems/rtems_glue.c @@ -378,9 +378,6 @@ rtems_bsdnet_semaphore_obtain (void) #ifdef RTEMS_FAST_MUTEX ISR_lock_Context lock_context; Thread_Control *executing; -#ifdef RTEMS_SMP - _Thread_Disable_dispatch(); -#endif _ISR_lock_ISR_disable(&lock_context); if (!the_networkSemaphore) rtems_panic ("rtems-net: network sema obtain: network not initialised\n"); @@ -393,9 +390,6 @@ rtems_bsdnet_semaphore_obtain (void) 0, /* forever */ &lock_context ); -#ifdef RTEMS_SMP - _Thread_Enable_dispatch(); -#endif if (executing->Wait.return_code) rtems_panic ("rtems-net: can't obtain network sema: %d\n", executing->Wait.return_code); @@ -416,18 +410,19 @@ void rtems_bsdnet_semaphore_release (void) { #ifdef RTEMS_FAST_MUTEX - int i; + ISR_lock_Context lock_context; + CORE_mutex_Status status; - _Thread_Disable_dispatch(); if (!the_networkSemaphore) rtems_panic ("rtems-net: network sema obtain: network not initialised\n"); - i = _CORE_mutex_Surrender ( + _ISR_lock_ISR_disable(&lock_context); + status = _CORE_mutex_Surrender ( &the_networkSemaphore->Core_control.mutex, networkSemaphore, - NULL + NULL, + &lock_context ); - _Thread_Enable_dispatch(); - if (i) + if (status != CORE_MUTEX_STATUS_SUCCESSFUL) rtems_panic ("rtems-net: can't release network sema: %i\n"); #else rtems_status_code sc; |