Changeset b23c88e in mainline for kernel/generic/src/time/clock.c


Ignore:
Timestamp:
2012-07-11T05:45:48Z (12 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b68ae24
Parents:
9f8745c5
Message:

preemption_disable: Replaced memory barriers with compiler barriers. Added checks if reschedule is needed once preemption is enabled.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/time/clock.c

    r9f8745c5 rb23c88e  
    212212                irq_spinlock_unlock(&THREAD->lock, false);
    213213               
    214                 if ((!ticks) && (!PREEMPTION_DISABLED)) {
    215                         scheduler();
     214                if (ticks == 0) {
     215                        if (PREEMPTION_ENABLED) {
     216                                scheduler();
    216217#ifdef CONFIG_UDEBUG
    217                         /*
    218                          * Give udebug chance to stop the thread
    219                          * before it begins executing userspace code.
    220                          */
    221                         istate_t *istate = THREAD->udebug.uspace_state;
    222                         if ((istate) && (istate_from_uspace(istate)))
    223                                 udebug_before_thread_runs();
     218                                /*
     219                                * Give udebug chance to stop the thread
     220                                * before it begins executing userspace code.
     221                                */
     222                                istate_t *istate = THREAD->udebug.uspace_state;
     223                                if ((istate) && (istate_from_uspace(istate)))
     224                                        udebug_before_thread_runs();
    224225#endif
     226                        } else {
     227                                THREAD->need_resched = true;
     228                        }
    225229                }
    226230        }
Note: See TracChangeset for help on using the changeset viewer.