summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/sem.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1995-08-28 15:30:29 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1995-08-28 15:30:29 +0000
commit7f6a24abdd1793e394e4d5d49de1f4ca0e00297a (patch)
treefbdb1ec31289dabb5bf41ed769d4b40ca8cf9a9a /cpukit/rtems/src/sem.c
parentMoved _Thread_Information -> _RTEMS_tasks_Information. (diff)
downloadrtems-7f6a24abdd1793e394e4d5d49de1f4ca0e00297a.tar.bz2
Added unused priority ceiling parameter to rtems_semaphore_create.
Rearranged code to created thread handler routines to initialize, start, restart, and "close/delete" a thread. Made internal threads their own object class. This now uses the thread support routines for starting and initializing a thread. Insured deleted tasks are freed to the Inactive pool associated with the correct Information block. Added an RTEMS API specific data area to the thread control block. Beginnings of removing the word "rtems" from the core.
Diffstat (limited to 'cpukit/rtems/src/sem.c')
-rw-r--r--cpukit/rtems/src/sem.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/cpukit/rtems/src/sem.c b/cpukit/rtems/src/sem.c
index d810c205ee..9e87550c31 100644
--- a/cpukit/rtems/src/sem.c
+++ b/cpukit/rtems/src/sem.c
@@ -87,10 +87,11 @@ void _Semaphore_Manager_initialization(
*/
rtems_status_code rtems_semaphore_create(
- rtems_name name,
- unsigned32 count,
- rtems_attribute attribute_set,
- Objects_Id *id
+ rtems_name name,
+ unsigned32 count,
+ rtems_attribute attribute_set,
+ rtems_task_priority priority_ceiling,
+ Objects_Id *id
)
{
register Semaphore_Control *the_semaphore;
@@ -127,7 +128,7 @@ rtems_status_code rtems_semaphore_create(
}
if ( _Attributes_Is_global( attribute_set ) &&
- !( _Objects_MP_Open( &_Semaphore_Information, name,
+ !( _Objects_MP_Allocate_and_open( &_Semaphore_Information, name,
the_semaphore->Object.id, FALSE ) ) ) {
_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
@@ -148,8 +149,14 @@ rtems_status_code rtems_semaphore_create(
the_semaphore->holder_id = 0;
}
- _Thread_queue_Initialize( &the_semaphore->Wait_queue,
- attribute_set, STATES_WAITING_FOR_SEMAPHORE );
+ _Thread_queue_Initialize(
+ &the_semaphore->Wait_queue,
+ OBJECTS_RTEMS_SEMAPHORES,
+ _Attributes_Is_priority( attribute_set ) ?
+ THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO,
+ STATES_WAITING_FOR_SEMAPHORE,
+ _Semaphore_MP_Send_extract_proxy
+ );
_Objects_Open( &_Semaphore_Information, &the_semaphore->Object, &name );