Changeset ba25c4b in mainline for kernel/generic/src/time/timeout.c
- Timestamp:
- 2023-02-09T15:31:39Z (22 months ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 83789ea2
- Parents:
- 78acbc72
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-09 15:28:13)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-09 15:31:39)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/time/timeout.c
r78acbc72 rba25c4b 90 90 assert(!link_in_use(&timeout->link)); 91 91 92 timeout->cpu = CPU; 93 timeout->deadline = CPU->current_clock_tick + us2ticks(time); 94 timeout->handler = handler; 95 timeout->arg = arg; 92 *timeout = (timeout_t) { 93 .cpu = CPU, 94 .deadline = CPU->current_clock_tick + us2ticks(time), 95 .handler = handler, 96 .arg = arg, 97 .finished = ATOMIC_VAR_INIT(false), 98 }; 96 99 97 100 /* Insert timeout into the active timeouts list according to timeout->deadline. */ … … 135 138 136 139 irq_spinlock_unlock(&timeout->cpu->timeoutlock, true); 140 141 if (!success) { 142 /* Timeout was fired, we need to wait for the callback to finish. */ 143 while (!atomic_load_explicit(&timeout->finished, memory_order_acquire)) 144 cpu_spin_hint(); 145 } 146 137 147 return success; 138 148 }
Note:
See TracChangeset
for help on using the changeset viewer.