summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/posix/src')
-rw-r--r--cpukit/posix/src/mutexlocksupp.c7
-rw-r--r--cpukit/posix/src/mutexsetprioceiling.c11
-rw-r--r--cpukit/posix/src/mutexunlock.c11
3 files changed, 16 insertions, 13 deletions
diff --git a/cpukit/posix/src/mutexlocksupp.c b/cpukit/posix/src/mutexlocksupp.c
index 9b20f58d13..b63a89aa4e 100644
--- a/cpukit/posix/src/mutexlocksupp.c
+++ b/cpukit/posix/src/mutexlocksupp.c
@@ -54,9 +54,6 @@ int _POSIX_Mutex_Lock_support(
switch ( location ) {
case OBJECTS_LOCAL:
-#if defined(RTEMS_SMP)
- _Thread_Disable_dispatch();
-#endif
executing = _Thread_Executing;
_CORE_mutex_Seize(
&the_mutex->Mutex,
@@ -66,10 +63,6 @@ int _POSIX_Mutex_Lock_support(
timeout,
&lock_context
);
-#if defined(RTEMS_SMP)
- _Thread_Enable_dispatch();
-#endif
- _Objects_Put_for_get_isr_disable( &the_mutex->Object );
return _POSIX_Mutex_Translate_core_mutex_return_code(
(CORE_mutex_Status) executing->Wait.return_code
);
diff --git a/cpukit/posix/src/mutexsetprioceiling.c b/cpukit/posix/src/mutexsetprioceiling.c
index f0fb8f5ee6..32d92107cc 100644
--- a/cpukit/posix/src/mutexsetprioceiling.c
+++ b/cpukit/posix/src/mutexsetprioceiling.c
@@ -41,6 +41,7 @@ int pthread_mutex_setprioceiling(
register POSIX_Mutex_Control *the_mutex;
Objects_Locations location;
Priority_Control the_priority;
+ ISR_lock_Context lock_context;
if ( !old_ceiling )
return EINVAL;
@@ -64,7 +65,11 @@ int pthread_mutex_setprioceiling(
* NOTE: This makes it easier to get 100% binary coverage since the
* bad Id case is handled by the switch.
*/
- the_mutex = _POSIX_Mutex_Get( mutex, &location );
+ the_mutex = _POSIX_Mutex_Get_interrupt_disable(
+ mutex,
+ &location,
+ &lock_context
+ );
switch ( location ) {
case OBJECTS_LOCAL:
@@ -78,9 +83,9 @@ int pthread_mutex_setprioceiling(
_CORE_mutex_Surrender(
&the_mutex->Mutex,
the_mutex->Object.id,
- NULL
+ NULL,
+ &lock_context
);
- _Objects_Put( &the_mutex->Object );
return 0;
diff --git a/cpukit/posix/src/mutexunlock.c b/cpukit/posix/src/mutexunlock.c
index dbb9d1a3e6..c5b2375d1a 100644
--- a/cpukit/posix/src/mutexunlock.c
+++ b/cpukit/posix/src/mutexunlock.c
@@ -41,17 +41,22 @@ int pthread_mutex_unlock(
register POSIX_Mutex_Control *the_mutex;
Objects_Locations location;
CORE_mutex_Status status;
+ ISR_lock_Context lock_context;
- the_mutex = _POSIX_Mutex_Get( mutex, &location );
+ the_mutex = _POSIX_Mutex_Get_interrupt_disable(
+ mutex,
+ &location,
+ &lock_context
+ );
switch ( location ) {
case OBJECTS_LOCAL:
status = _CORE_mutex_Surrender(
&the_mutex->Mutex,
the_mutex->Object.id,
- NULL
+ NULL,
+ &lock_context
);
- _Objects_Put( &the_mutex->Object );
return _POSIX_Mutex_Translate_core_mutex_return_code( status );
#if defined(RTEMS_MULTIPROCESSING)