Changeset 83789ea2 in mainline for kernel/generic/src/proc/thread.c


Ignore:
Timestamp:
2023-02-09T16:12:24Z (2 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c0b54c9
Parents:
ba25c4b
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2022-08-16 17:52:15)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-09 16:12:24)
Message:

Simplify timeout handling

Since timeout_unregister() now waits for the handler to complete,
we can get rid of some of the bookkeeping in waitq and thread code.
We can also turn timeout_t into a local variable instead of
keeping it around in thread_t.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/proc/thread.c

    rba25c4b r83789ea2  
    360360        thread->state = Entering;
    361361
    362         timeout_initialize(&thread->sleep_timeout);
    363362        thread->sleep_interruptible = false;
    364363        thread->sleep_composable = false;
    365364        thread->sleep_queue = NULL;
    366         thread->timeout_pending = false;
    367365
    368366        thread->in_copy_from_uspace = false;
     
    500498        }
    501499
    502 restart:
    503500        irq_spinlock_lock(&THREAD->lock, true);
    504         if (THREAD->timeout_pending) {
    505                 /* Busy waiting for timeouts in progress */
    506                 irq_spinlock_unlock(&THREAD->lock, true);
    507                 goto restart;
    508         }
    509 
    510501        THREAD->state = Exiting;
    511502        irq_spinlock_unlock(&THREAD->lock, true);
Note: See TracChangeset for help on using the changeset viewer.