Changeset ea2c1d6 in rtems
- Timestamp:
- 01/12/00 20:22:04 (23 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- bd9e482a
- Parents:
- e38cb52
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/score/src/coremsgseize.c
re38cb52 rea2c1d6 62 62 unsigned32 *size, 63 63 boolean wait, 64 CORE_message_queue_Submit_types *priority,65 64 Watchdog_Interval timeout 66 65 ) … … 69 68 CORE_message_queue_Buffer_control *the_message; 70 69 Thread_Control *executing; 70 Thread_Control *the_thread; 71 71 72 72 executing = _Thread_Executing; … … 78 78 the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); 79 79 _ISR_Enable( level ); 80 80 81 *size = the_message->Contents.size; 81 *priority = the_message->priority; 82 _CORE_message_queue_Copy_buffer(the_message->Contents.buffer,buffer,*size ); 83 _CORE_message_queue_Free_message_buffer(the_message_queue, the_message ); 82 _Thread_Executing->Wait.count = the_message->priority; 83 _CORE_message_queue_Copy_buffer(the_message->Contents.buffer,buffer,*size); 84 85 /* 86 * There could be a thread waiting to send a message. If there 87 * is not, then we can go ahead and free the buffer. 88 * 89 * NOTE: If we note that the queue was not full before this receive, 90 * then we can avoid this dequeue. 91 */ 92 93 the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 94 if ( !the_thread ) { 95 _CORE_message_queue_Free_message_buffer( the_message_queue, the_message ); 96 return; 97 } 98 99 /* 100 * There was a thread waiting to send a message. This code 101 * puts the messages in the message queue on behalf of the 102 * waiting task. 103 */ 104 105 the_message->priority = the_thread->Wait.count; 106 the_message->Contents.size = (unsigned32)the_thread->Wait.return_argument_1; 107 _CORE_message_queue_Copy_buffer( 108 the_thread->Wait.return_argument, 109 the_message->Contents.buffer, 110 the_message->Contents.size 111 ); 112 113 _CORE_message_queue_Insert_message( 114 the_message_queue, 115 the_message, 116 the_message->priority 117 ); 84 118 return; 85 119 } … … 96 130 executing->Wait.return_argument = (void *)buffer; 97 131 executing->Wait.return_argument_1 = (void *)size; 132 /* Wait.count will be filled in with the message priority */ 98 133 _ISR_Enable( level ); 99 134 -
cpukit/score/src/coremsgseize.c
re38cb52 rea2c1d6 62 62 unsigned32 *size, 63 63 boolean wait, 64 CORE_message_queue_Submit_types *priority,65 64 Watchdog_Interval timeout 66 65 ) … … 69 68 CORE_message_queue_Buffer_control *the_message; 70 69 Thread_Control *executing; 70 Thread_Control *the_thread; 71 71 72 72 executing = _Thread_Executing; … … 78 78 the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); 79 79 _ISR_Enable( level ); 80 80 81 *size = the_message->Contents.size; 81 *priority = the_message->priority; 82 _CORE_message_queue_Copy_buffer(the_message->Contents.buffer,buffer,*size ); 83 _CORE_message_queue_Free_message_buffer(the_message_queue, the_message ); 82 _Thread_Executing->Wait.count = the_message->priority; 83 _CORE_message_queue_Copy_buffer(the_message->Contents.buffer,buffer,*size); 84 85 /* 86 * There could be a thread waiting to send a message. If there 87 * is not, then we can go ahead and free the buffer. 88 * 89 * NOTE: If we note that the queue was not full before this receive, 90 * then we can avoid this dequeue. 91 */ 92 93 the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 94 if ( !the_thread ) { 95 _CORE_message_queue_Free_message_buffer( the_message_queue, the_message ); 96 return; 97 } 98 99 /* 100 * There was a thread waiting to send a message. This code 101 * puts the messages in the message queue on behalf of the 102 * waiting task. 103 */ 104 105 the_message->priority = the_thread->Wait.count; 106 the_message->Contents.size = (unsigned32)the_thread->Wait.return_argument_1; 107 _CORE_message_queue_Copy_buffer( 108 the_thread->Wait.return_argument, 109 the_message->Contents.buffer, 110 the_message->Contents.size 111 ); 112 113 _CORE_message_queue_Insert_message( 114 the_message_queue, 115 the_message, 116 the_message->priority 117 ); 84 118 return; 85 119 } … … 96 130 executing->Wait.return_argument = (void *)buffer; 97 131 executing->Wait.return_argument_1 = (void *)size; 132 /* Wait.count will be filled in with the message priority */ 98 133 _ISR_Enable( level ); 99 134
Note: See TracChangeset
for help on using the changeset viewer.