[PATCH v2 4/5] score: Turn thread lock into thread wait lock

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Jul 27 05:36:10 UTC 2016



On 27/07/16 06:43, Chris Johns wrote:
> My comments are mixed into the patch.
>
> On 26/07/2016 19:20, Sebastian Huber wrote:
[...]

>> +#if defined(RTEMS_SMP)
>> +  /**
>> +   * @brief Thread wait lock control block.
>> +   *
>> +   * Parts of the thread wait information is protected by the thread 
>> wait
> * Parts of the thread wait information are protected by the thread wait
>> +   * default lock and additionally a thread queue lock in case the 
>> thread
>> +   * currently blocks on a thread queue.
> ? * is blocked on a thread queue.
>> +   *
>> +   * The thread wait lock mechanism protects the following thread 
>> variables
>> +   *  - POSIX_API_Control::Attributes,
>> +   *  - Thread_Control::current_priority,
>> +   *  - Thread_Control::Wait::Lock::Pending_requests,
>> +   *  - Thread_Control::Wait::queue, and
>> +   *  - Thread_Control::Wait::operations.
>> +   *
>> +   * @see _Thread_Wait_acquire(), _Thread_Wait_release(), 
>> _Thread_Wait_claim()
>> +   *   and _Thread_Wait_restore_default().
>> +   */
>> +  struct {
>> +    /**
>> +     * @brief Thread wait default lock.
>> +     */
>> +    ISR_lock_Control Default;
>> +
>> +    /**
>> +     * @brief The pending thread wait lock acquire or tranquilize 
>> requests in
>
> What does 'tranquilize' mean here? I think this need some more detail.

I added a reference to _Thread_Wait_tranquilize().

>
>> +     * case the thread is blocked on a thread queue.
>> +     */
>> +    Chain_Control Pending_requests;
>> +  } Lock;
>> +#endif
>> +
>> +  /**
>> +   * @brief The current thread queue.
>> +   *
>> +   * In case this field is @c NULL, then the thread is not blocked 
>> on a thread
>
> ? * If this field is @c NULL the thread is not blocked on a thread
>
>> +   * queue.  This field is protected by the thread wait default lock.
>> +   *
>> +   * @see _Thread_Wait_claim().
>> +   */
>> +  Thread_queue_Queue *queue;
>> +
>>     /**
>>      * @brief The current thread queue operations.
>>      *
>> -   * This field is protected by the thread lock.
>> +   * This field is protected by the thread lock wait default lock.
>>      *
>> -   * @see _Thread_Lock_set() and _Thread_Wait_set_operations().
>> +   * @see _Thread_Wait_claim().
>>      */
>>     const Thread_queue_Operations *operations;
>>
>> @@ -639,66 +671,6 @@ typedef struct  {
>>     void *        control;
>>   }Thread_Capture_control;
>>
>> -#if defined(RTEMS_SMP)
>> -/**
>> - * @brief Thread lock control.
>> - *
>> - * The thread lock is either the default lock or the lock of the 
>> resource on
>> - * which the thread is currently blocked.  The generation number 
>> takes care
>> - * that the up to date lock is used.  Only resources using fine 
>> grained locking
>
> ? ...  The generation number make sure an to date lock is used. ...

This part is removed by the patch.

[...]
>> +
>> +/**
>> + * @brief Tranquilizes a thread wait on a thread queue procedure.
>
> Again I am not sure what "tranquilizes" means. My dictionary states:
>
> "To render tranquil; to allay when agitated; to compose; to
>  make calm and peaceful; as, to tranquilize a state disturbed
>  by factions or civil commotions; to tranquilize the mind."
>
> Is this thread agitated? Is this making the thread calmer? Are you 
> sedating the thread? :)

After the violent blocking procedure you make the thread calm and 
peaceful again so that it can carry out its normal work.

>
> Is quiesce or silent better?

I am open for suggestions, but I think quiesce and silent is not better 
here.

[...]

-- 
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