Skip to content

Commit 7327966

Browse files
committed
extmod/modutimeq: Make time_less_than be actually "less than", not less/eq.
This fixes an obvious case of non-fair scheduling of 2 tasks with the same deadline.
1 parent 18f12ca commit 7327966

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

extmod/modutimeq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ STATIC bool time_less_than(struct qentry *item, struct qentry *parent) {
6666
if ((mp_int_t)res < 0) {
6767
res += MODULO;
6868
}
69-
return res < (MODULO / 2);
69+
return res && res < (MODULO / 2);
7070
}
7171

7272
STATIC mp_obj_t utimeq_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {

0 commit comments

Comments
 (0)