[PATCH 20/45] score: More thread queue operations

Sebastian Huber sebastian.huber at embedded-brains.de
Mon May 18 07:25:01 UTC 2015



On 17/05/15 13:23, Gedare Bloom wrote:
> On Fri, May 15, 2015 at 7:41 AM, Sebastian Huber
> <sebastian.huber at embedded-brains.de> wrote:
>> Move thread queue discipline specific operations into
>> Thread_queue_Operations.  Use a separate node in the thread control
>> block for the thread queue to make it independent of the scheduler data
>> structures.
>>
>> Update #2273.
>> ---
> [...]
>>   const Thread_queue_Operations _Thread_queue_Operations_default = {
>> -  .priority_change = _Thread_queue_Do_nothing_priority_change
>> +  .priority_change = _Thread_queue_Do_nothing_priority_change,
>> +  .extract = _Thread_queue_Do_nothing_extract
>>   };
>>
> Any reason not to set default values for the other operations? Or
> explicitly to NULL?

I add this comment:

/* The default operations are only used in _Thread_Change_priority() and 
_Thread_Timeout() and don't have a thread queue associated with them, so 
the enqueue and first operations are superfluous. */

I just noticed that the dequeue operation is obsolete. I will remove it.

>
>>   const Thread_queue_Operations _Thread_queue_Operations_FIFO = {
>> -  .priority_change = _Thread_queue_Do_nothing_priority_change
>> +  .priority_change = _Thread_queue_Do_nothing_priority_change,
>> +  .initialize = _Thread_queue_FIFO_initialize,
>> +  .enqueue = _Thread_queue_FIFO_enqueue,
>> +  .dequeue = _Thread_queue_FIFO_dequeue,
>> +  .extract = _Thread_queue_FIFO_extract,
>> +  .first = _Thread_queue_FIFO_first
>>   };
>>
>>   const Thread_queue_Operations _Thread_queue_Operations_priority = {
>> -  .priority_change = _Thread_queue_Priority_priority_change
>> +  .priority_change = _Thread_queue_Priority_priority_change,
>> +  .initialize = _Thread_queue_Priority_initialize,
>> +  .enqueue = _Thread_queue_Priority_enqueue,
>> +  .dequeue = _Thread_queue_Priority_dequeue,
>> +  .extract = _Thread_queue_Priority_extract,
>> +  .first = _Thread_queue_Priority_first
>>   };
> Would it make sense to separate the _Thread_queue_Priority operations
> to their own file?

Since the thread queues are initialized with the discipline enum, we 
always have these operations in the executable.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the devel mailing list