os: simplify smart scheduler init process
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
d9c18c3b9b
commit
7d8cabd027
|
@ -136,7 +136,7 @@ extern _X_EXPORT void SmartScheduleStopTimer(void);
|
||||||
#define SMART_MAX_PRIORITY (20)
|
#define SMART_MAX_PRIORITY (20)
|
||||||
#define SMART_MIN_PRIORITY (-20)
|
#define SMART_MIN_PRIORITY (-20)
|
||||||
|
|
||||||
extern _X_EXPORT Bool SmartScheduleInit(void);
|
extern _X_EXPORT void SmartScheduleInit(void);
|
||||||
|
|
||||||
|
|
||||||
/* This prototype is used pervasively in Xext, dix */
|
/* This prototype is used pervasively in Xext, dix */
|
||||||
|
|
|
@ -305,9 +305,7 @@ OsInit(void)
|
||||||
* log file name if logging to a file is desired.
|
* log file name if logging to a file is desired.
|
||||||
*/
|
*/
|
||||||
LogInit(NULL, NULL);
|
LogInit(NULL, NULL);
|
||||||
if (!SmartScheduleDisable)
|
SmartScheduleInit ();
|
||||||
if (!SmartScheduleInit ())
|
|
||||||
SmartScheduleDisable = TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -1155,13 +1155,13 @@ SmartScheduleTimer (int sig)
|
||||||
SmartScheduleTime += SmartScheduleInterval;
|
SmartScheduleTime += SmartScheduleInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
void
|
||||||
SmartScheduleInit (void)
|
SmartScheduleInit (void)
|
||||||
{
|
{
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
|
|
||||||
if (SmartScheduleDisable)
|
if (SmartScheduleDisable)
|
||||||
return TRUE;
|
return;
|
||||||
|
|
||||||
memset((char *) &act, 0, sizeof(struct sigaction));
|
memset((char *) &act, 0, sizeof(struct sigaction));
|
||||||
|
|
||||||
|
@ -1172,9 +1172,8 @@ SmartScheduleInit (void)
|
||||||
if (sigaction (SIGALRM, &act, 0) < 0)
|
if (sigaction (SIGALRM, &act, 0) < 0)
|
||||||
{
|
{
|
||||||
perror ("sigaction for smart scheduler");
|
perror ("sigaction for smart scheduler");
|
||||||
return FALSE;
|
SmartScheduleDisable = TRUE;
|
||||||
}
|
}
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SIG_BLOCK
|
#ifdef SIG_BLOCK
|
||||||
|
|
Loading…
Reference in New Issue