os: remove useless smart scheduler macros
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
This commit is contained in:
parent
a9e6080dc9
commit
d9c18c3b9b
21
os/utils.c
21
os/utils.c
|
@ -1121,17 +1121,9 @@ XNFstrdup(const char *s)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define SMART_SCHEDULE_POSSIBLE
|
|
||||||
#ifdef SMART_SCHEDULE_POSSIBLE
|
|
||||||
#define SMART_SCHEDULE_SIGNAL SIGALRM
|
|
||||||
#define SMART_SCHEDULE_TIMER ITIMER_REAL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
SmartScheduleStopTimer (void)
|
SmartScheduleStopTimer (void)
|
||||||
{
|
{
|
||||||
#ifdef SMART_SCHEDULE_POSSIBLE
|
|
||||||
struct itimerval timer;
|
struct itimerval timer;
|
||||||
|
|
||||||
if (SmartScheduleDisable)
|
if (SmartScheduleDisable)
|
||||||
|
@ -1141,13 +1133,11 @@ SmartScheduleStopTimer (void)
|
||||||
timer.it_value.tv_sec = 0;
|
timer.it_value.tv_sec = 0;
|
||||||
timer.it_value.tv_usec = 0;
|
timer.it_value.tv_usec = 0;
|
||||||
(void) setitimer (ITIMER_REAL, &timer, 0);
|
(void) setitimer (ITIMER_REAL, &timer, 0);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SmartScheduleStartTimer (void)
|
SmartScheduleStartTimer (void)
|
||||||
{
|
{
|
||||||
#ifdef SMART_SCHEDULE_POSSIBLE
|
|
||||||
struct itimerval timer;
|
struct itimerval timer;
|
||||||
|
|
||||||
if (SmartScheduleDisable)
|
if (SmartScheduleDisable)
|
||||||
|
@ -1157,21 +1147,17 @@ SmartScheduleStartTimer (void)
|
||||||
timer.it_value.tv_sec = 0;
|
timer.it_value.tv_sec = 0;
|
||||||
timer.it_value.tv_usec = SmartScheduleInterval * 1000;
|
timer.it_value.tv_usec = SmartScheduleInterval * 1000;
|
||||||
setitimer (ITIMER_REAL, &timer, 0);
|
setitimer (ITIMER_REAL, &timer, 0);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SMART_SCHEDULE_POSSIBLE
|
|
||||||
static void
|
static void
|
||||||
SmartScheduleTimer (int sig)
|
SmartScheduleTimer (int sig)
|
||||||
{
|
{
|
||||||
SmartScheduleTime += SmartScheduleInterval;
|
SmartScheduleTime += SmartScheduleInterval;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
SmartScheduleInit (void)
|
SmartScheduleInit (void)
|
||||||
{
|
{
|
||||||
#ifdef SMART_SCHEDULE_POSSIBLE
|
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
|
|
||||||
if (SmartScheduleDisable)
|
if (SmartScheduleDisable)
|
||||||
|
@ -1182,16 +1168,13 @@ SmartScheduleInit (void)
|
||||||
/* Set up the timer signal function */
|
/* Set up the timer signal function */
|
||||||
act.sa_handler = SmartScheduleTimer;
|
act.sa_handler = SmartScheduleTimer;
|
||||||
sigemptyset (&act.sa_mask);
|
sigemptyset (&act.sa_mask);
|
||||||
sigaddset (&act.sa_mask, SMART_SCHEDULE_SIGNAL);
|
sigaddset (&act.sa_mask, SIGALRM);
|
||||||
if (sigaction (SMART_SCHEDULE_SIGNAL, &act, 0) < 0)
|
if (sigaction (SIGALRM, &act, 0) < 0)
|
||||||
{
|
{
|
||||||
perror ("sigaction for smart scheduler");
|
perror ("sigaction for smart scheduler");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#else
|
|
||||||
return FALSE;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SIG_BLOCK
|
#ifdef SIG_BLOCK
|
||||||
|
|
Loading…
Reference in New Issue
Block a user