History log of /haiku/src/system/kernel/UserTimer.cpp
Revision Date Author Comments
# 8085ed3f 11-Jun-2018 Augustin Cavalier <waddlesplash@gmail.com>

UserTimer: Zero-initialize sigevents.

CID 1234670 and friends. Probably harmless, though.


# 1f7e5bde 12-Dec-2016 Michael Lotz <mmlr@mlotz.ch>

kernel: Fix NULL dereference in ThreadTimeUserTimer::Schedule().

The SpinLocker was always initialized to fThread->time_lock even though
fThread may be NULL. This looks like a simple oversight as the rest of
the method handles fThread being NULL and the team variants of these
timers have very similar logic and do the NULL check as well.

This fixes the last remaining KDL in the posixtestsuite.


# 52d500e5 28-Oct-2014 Michael Lotz <mmlr@mlotz.ch>

kernel: Workaround for double lock of spinlock in user timers.

The thread that is being [un]scheduled already has its time_lock locked
in {stop|continue}_cpu_timers(). When updating the TeamTimeUserTimer,
the team is asked for its cpu time. Team::CPUTime() then iterates the
threads of the team and locks the time_lock of the thread again.

This workaround passes a possibly locked thread through the relevant
functions so Team::CPUTime() can decide whether or not a thread it
iterates needs to be locked or not.

This works around #11032 and its duplicates #11314 and #11344.


# d7e1e3e0 16-Mar-2014 Pawel Dziepak <pdziepak@quarnos.org>

kernel/UserEvent: Make sure UserEvent object is valid during DPC

Most of the actual UserEvent work is done in DPC so that we don't have
to care about the limitations of the context in which UserEvent::Fire()
is invoked. This requires appropriate management of lifetime of UserEvent
instances to make sure that DoDPC() method is always called on a valid
object.


# 7db89e8d 25-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: Rework cpuidle module

* Create new interface for cpuidle modules (similar to the cpufreq
interface)
* Generic cpuidle module is no longer needed
* Fix and update Intel C-State module


# 72addc62 07-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: Introduce Thread::time_lock and Team::time_lock


# e7dba861 05-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: User{Event, Timer}: Use atomic access where necessary


# f4b088a9 04-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: Protect UserTimers with sUserTimerLock


# d8fcc8a8 30-Oct-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: Remove B_TIMER_ACQUIRE_SCHEDULER_LOCK flag

The flag main purpose is to avoid race conditions between event handler
and cancel_timer(). However, cancel_timer() is safe even without
using gSchedulerLock.

If the event is scheduled to happen on other CPU than the CPU that
invokes cancel_timer() then cancel_timer() either disables the event
before its handler starts executing or waits until the event handler
is done.

If the event is scheduled on the same CPU that calls cancel_timer()
then, since cancel_timer() disables interrupts, the event is either
executed before cancel_timer() or when the timer interrupt handler
starts running the event is already disabled.


# 24df6592 11-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged signals-merge branch into trunk with the following changes:
* Reorganized the kernel locking related to threads and teams.
* We now discriminate correctly between process and thread signals. Signal
handlers have been moved to teams. Fixes #5679.
* Implemented real-time signal support, including signal queuing, SA_SIGINFO
support, sigqueue(), sigwaitinfo(), sigtimedwait(), waitid(), and the addition
of the real-time signal range. Closes #1935 and #2695.
* Gave SIGBUS a separate signal number. Fixes #6704.
* Implemented <time.h> clock and timer support, and fixed/completed alarm() and
[set]itimer(). Closes #5682.
* Implemented support for thread cancellation. Closes #5686.
* Moved send_signal() from <signal.h> to <OS.h>. Fixes #7554.
* Lots over smaller more or less related changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42116 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52d500e5b4abc36a9c2106de52412da5324ca9ee 28-Oct-2014 Michael Lotz <mmlr@mlotz.ch>

kernel: Workaround for double lock of spinlock in user timers.

The thread that is being [un]scheduled already has its time_lock locked
in {stop|continue}_cpu_timers(). When updating the TeamTimeUserTimer,
the team is asked for its cpu time. Team::CPUTime() then iterates the
threads of the team and locks the time_lock of the thread again.

This workaround passes a possibly locked thread through the relevant
functions so Team::CPUTime() can decide whether or not a thread it
iterates needs to be locked or not.

This works around #11032 and its duplicates #11314 and #11344.


# d7e1e3e0120b00c88cae7a6828dd727062873dfe 16-Mar-2014 Pawel Dziepak <pdziepak@quarnos.org>

kernel/UserEvent: Make sure UserEvent object is valid during DPC

Most of the actual UserEvent work is done in DPC so that we don't have
to care about the limitations of the context in which UserEvent::Fire()
is invoked. This requires appropriate management of lifetime of UserEvent
instances to make sure that DoDPC() method is always called on a valid
object.


# 7db89e8dc395db73368479fd9817b2b67899f3f6 25-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: Rework cpuidle module

* Create new interface for cpuidle modules (similar to the cpufreq
interface)
* Generic cpuidle module is no longer needed
* Fix and update Intel C-State module


# 72addc62e042d2a39fba1f04e2cc8dadc155adfe 07-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: Introduce Thread::time_lock and Team::time_lock


# e7dba861fd89792538442cc1b01584f7dabbd4a9 05-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: User{Event, Timer}: Use atomic access where necessary


# f4b088a992fefefc87aae57643aca05d81826cca 04-Nov-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: Protect UserTimers with sUserTimerLock


# d8fcc8a82519cef977c689cee497316be6f1531f 30-Oct-2013 Pawel Dziepak <pdziepak@quarnos.org>

kernel: Remove B_TIMER_ACQUIRE_SCHEDULER_LOCK flag

The flag main purpose is to avoid race conditions between event handler
and cancel_timer(). However, cancel_timer() is safe even without
using gSchedulerLock.

If the event is scheduled to happen on other CPU than the CPU that
invokes cancel_timer() then cancel_timer() either disables the event
before its handler starts executing or waits until the event handler
is done.

If the event is scheduled on the same CPU that calls cancel_timer()
then, since cancel_timer() disables interrupts, the event is either
executed before cancel_timer() or when the timer interrupt handler
starts running the event is already disabled.


# 24df65921befcd0ad0c5c7866118f922da61cb96 11-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged signals-merge branch into trunk with the following changes:
* Reorganized the kernel locking related to threads and teams.
* We now discriminate correctly between process and thread signals. Signal
handlers have been moved to teams. Fixes #5679.
* Implemented real-time signal support, including signal queuing, SA_SIGINFO
support, sigqueue(), sigwaitinfo(), sigtimedwait(), waitid(), and the addition
of the real-time signal range. Closes #1935 and #2695.
* Gave SIGBUS a separate signal number. Fixes #6704.
* Implemented <time.h> clock and timer support, and fixed/completed alarm() and
[set]itimer(). Closes #5682.
* Implemented support for thread cancellation. Closes #5686.
* Moved send_signal() from <signal.h> to <OS.h>. Fixes #7554.
* Lots over smaller more or less related changes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42116 a95241bf-73f2-0310-859d-f6bbb57e9c96