Changeset 8f0529f in rtems
- Timestamp:
- 11/02/99 15:58:09 (23 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 2cd5444
- Parents:
- 9693fdac
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/score/include/rtems/score/coresem.h
r9693fdac r8f0529f 56 56 CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT, 57 57 CORE_SEMAPHORE_WAS_DELETED, 58 CORE_SEMAPHORE_TIMEOUT 58 CORE_SEMAPHORE_TIMEOUT, 59 CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED 59 60 } CORE_semaphore_Status; 60 61 … … 65 66 66 67 typedef struct { 68 unsigned32 maximum_count; 67 69 CORE_semaphore_Disciplines discipline; 68 70 } CORE_semaphore_Attributes; -
c/src/exec/score/src/coresem.c
r9693fdac r8f0529f 92 92 { 93 93 Thread_Control *the_thread; 94 ISR_Level level; 95 CORE_semaphore_Status status; 96 97 status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 94 98 95 99 if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { … … 98 102 (*api_semaphore_mp_support) ( the_thread, id ); 99 103 100 } else 101 the_semaphore->count += 1; 104 } else { 105 _ISR_Disable( level ); 106 if ( the_semaphore->count <= the_semaphore->Attributes.maximum_count ) 107 the_semaphore->count += 1; 108 else 109 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 110 _ISR_Enable( level ); 111 } 102 112 103 return ( CORE_SEMAPHORE_STATUS_SUCCESSFUL );113 return status; 104 114 } 105 115 -
cpukit/score/include/rtems/score/coresem.h
r9693fdac r8f0529f 56 56 CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT, 57 57 CORE_SEMAPHORE_WAS_DELETED, 58 CORE_SEMAPHORE_TIMEOUT 58 CORE_SEMAPHORE_TIMEOUT, 59 CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED 59 60 } CORE_semaphore_Status; 60 61 … … 65 66 66 67 typedef struct { 68 unsigned32 maximum_count; 67 69 CORE_semaphore_Disciplines discipline; 68 70 } CORE_semaphore_Attributes; -
cpukit/score/src/coresem.c
r9693fdac r8f0529f 92 92 { 93 93 Thread_Control *the_thread; 94 ISR_Level level; 95 CORE_semaphore_Status status; 96 97 status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 94 98 95 99 if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { … … 98 102 (*api_semaphore_mp_support) ( the_thread, id ); 99 103 100 } else 101 the_semaphore->count += 1; 104 } else { 105 _ISR_Disable( level ); 106 if ( the_semaphore->count <= the_semaphore->Attributes.maximum_count ) 107 the_semaphore->count += 1; 108 else 109 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 110 _ISR_Enable( level ); 111 } 102 112 103 return ( CORE_SEMAPHORE_STATUS_SUCCESSFUL );113 return status; 104 114 } 105 115
Note: See TracChangeset
for help on using the changeset viewer.