summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/include
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-06 16:26:22 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-12 07:36:14 +0200
commit9555341f0fc309243e1d92f95e4278a7b820f485 (patch)
tree74c17533f5d7205a93bc4d993fda5de47d043fe9 /cpukit/posix/include
parentposix: Use proper lock for sigaction() (diff)
downloadrtems-9555341f0fc309243e1d92f95e4278a7b820f485.tar.bz2
posix: Use a dedicated lock for scheduler changes
Update #2555.
Diffstat (limited to 'cpukit/posix/include')
-rw-r--r--cpukit/posix/include/rtems/posix/pthreadimpl.h17
-rw-r--r--cpukit/posix/include/rtems/posix/threadsup.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/cpukit/posix/include/rtems/posix/pthreadimpl.h b/cpukit/posix/include/rtems/posix/pthreadimpl.h
index 42f10b08bc..ef5821e48f 100644
--- a/cpukit/posix/include/rtems/posix/pthreadimpl.h
+++ b/cpukit/posix/include/rtems/posix/pthreadimpl.h
@@ -223,6 +223,23 @@ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Join_dequeue(
);
}
+RTEMS_INLINE_ROUTINE void _POSIX_Threads_Scheduler_acquire(
+ POSIX_API_Control *api,
+ ISR_lock_Context *lock_context
+)
+{
+ _ISR_lock_ISR_disable_and_acquire( &api->Scheduler_lock, lock_context );
+}
+
+RTEMS_INLINE_ROUTINE void _POSIX_Threads_Scheduler_release(
+ POSIX_API_Control *api,
+ ISR_lock_Context *lock_context
+)
+{
+ _ISR_lock_Release_and_ISR_enable( &api->Scheduler_lock, lock_context );
+}
+
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/posix/include/rtems/posix/threadsup.h b/cpukit/posix/include/rtems/posix/threadsup.h
index 7cd235409c..93ba2c1c7c 100644
--- a/cpukit/posix/include/rtems/posix/threadsup.h
+++ b/cpukit/posix/include/rtems/posix/threadsup.h
@@ -19,6 +19,7 @@
#define _RTEMS_POSIX_THREADSUP_H
#include <rtems/score/coresem.h>
+#include <rtems/score/isrlock.h>
#include <rtems/score/thread.h>
#include <rtems/score/threadq.h>
#include <rtems/score/watchdog.h>
@@ -51,6 +52,8 @@ typedef struct {
/** This is the set of threads waiting for the thread to exit. */
Thread_queue_Control Join_List;
/** This is the thread's current scheduling policy. */
+ ISR_LOCK_MEMBER( Scheduler_lock )
+ /** This is the thread's current scheduling policy. */
int schedpolicy;
/** This is the thread's current set of scheduling parameters. */
struct sched_param schedparam;