24df65921b
* 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
51 lines
1.4 KiB
C
51 lines
1.4 KiB
C
/*
|
|
* Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _SYSTEM_USER_TIMER_DEFS_H
|
|
#define _SYSTEM_USER_TIMER_DEFS_H
|
|
|
|
|
|
#include <limits.h>
|
|
#include <time.h>
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
#define CLOCK_PROCESS_USER_CPUTIME_ID ((clockid_t)-4)
|
|
/* clock measuring the used user CPU time of the current process */
|
|
|
|
// limits
|
|
#define MAX_USER_TIMERS_PER_TEAM _POSIX_TIMER_MAX
|
|
// maximum numbers of user-defined user timers (timer_create())
|
|
#define MAX_USER_TIMER_OVERRUN_COUNT INT_MAX
|
|
// cap value of a timer's overrun counter
|
|
|
|
#if MAX_USER_TIMER_OVERRUN_COUNT < _POSIX_DELAYTIMER_MAX
|
|
# error "MAX_USER_TIMER_OVERRUN_COUNT < _POSIX_DELAYTIMER_MAX"
|
|
#endif
|
|
|
|
#define USER_TIMER_REAL_TIME_ID 0
|
|
// predefined ID for the real time timer
|
|
#define USER_TIMER_TEAM_TOTAL_TIME_ID 1
|
|
// predefined ID for the team's total (kernel + user) time timer
|
|
#define USER_TIMER_TEAM_USER_TIME_ID 2
|
|
// predefined ID for the team's user time timer
|
|
#define USER_TIMER_FIRST_USER_DEFINED_ID 3
|
|
// first ID assigned to a user-defined timer (timer_create())
|
|
|
|
// _kern_create_user_timer() flag:
|
|
#define USER_TIMER_SIGNAL_THREAD 0x01
|
|
// send the signal to the thread instead of the team (valid only for thread
|
|
// timers)
|
|
|
|
|
|
struct user_timer_info {
|
|
bigtime_t remaining_time;
|
|
bigtime_t interval;
|
|
uint32 overrun_count;
|
|
};
|
|
|
|
|
|
#endif /* _SYSTEM_USER_TIMER_DEFS_H */
|