Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 46b305a in mainline


Ignore:
Timestamp:
2022-08-15T16:35:04Z (4 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
61ae4b0
Parents:
ad58fd2
Message:

Remove redundant timeout→lock

See the previous commit for explanation of why we can.

Location:
kernel/generic
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/time/timeout.h

    rad58fd2 r46b305a  
    4343
    4444typedef struct {
    45         IRQ_SPINLOCK_DECLARE(lock);
    46 
    4745        /** Link to the list of active timeouts on timeout->cpu */
    4846        link_t link;
  • kernel/generic/src/time/clock.c

    rad58fd2 r46b305a  
    163163                            link);
    164164
    165                         irq_spinlock_lock(&timeout->lock, false);
    166165                        if (current_clock_tick <= timeout->deadline) {
    167                                 irq_spinlock_unlock(&timeout->lock, false);
    168166                                break;
    169167                        }
     
    173171                        void *arg = timeout->arg;
    174172
    175                         irq_spinlock_unlock(&timeout->lock, false);
    176173                        irq_spinlock_unlock(&CPU->timeoutlock, false);
    177174
  • kernel/generic/src/time/timeout.c

    rad58fd2 r46b305a  
    6666void timeout_initialize(timeout_t *timeout)
    6767{
    68         irq_spinlock_initialize(&timeout->lock, "timeout_t_lock");
    6968        link_initialize(&timeout->link);
    7069        timeout->cpu = NULL;
     
    8786{
    8887        irq_spinlock_lock(&CPU->timeoutlock, true);
    89         irq_spinlock_lock(&timeout->lock, false);
    9088
    9189        timeout->cpu = CPU;
     
    103101            cur != NULL; cur = list_next(cur, &CPU->timeout_active_list)) {
    104102                target = list_get_instance(cur, timeout_t, link);
    105                 irq_spinlock_lock(&target->lock, false);
    106103
    107                 if (timeout->deadline < target->deadline) {
    108                         irq_spinlock_unlock(&target->lock, false);
     104                if (timeout->deadline < target->deadline)
    109105                        break;
    110                 }
    111106
    112                 irq_spinlock_unlock(&target->lock, false);
    113107                prev = cur;
    114108        }
     
    119113                list_insert_after(&timeout->link, prev);
    120114
    121         irq_spinlock_unlock(&timeout->lock, false);
    122115        irq_spinlock_unlock(&CPU->timeoutlock, true);
    123116}
Note: See TracChangeset for help on using the changeset viewer.