mirror of
https://github.com/reactos/reactos.git
synced 2024-07-23 20:58:16 +00:00
- add checkAlarms function
- this function will be used to determine wether expiration alarms are active. If qemu dies or terminates unexpectly, this function will check if it was before an timeout. In that case alarms will be active. Note: if qemu is killed purposely, OsSupport::cancelAlarms must be called to prevent automatic termination of sysreg process svn path=/trunk/; revision=29509
This commit is contained in:
parent
8e11e74890
commit
01a2631183
|
@ -15,7 +15,7 @@ namespace System_
|
||||||
OsSupport::TimeEntryVector OsSupport::s_Entries;
|
OsSupport::TimeEntryVector OsSupport::s_Entries;
|
||||||
|
|
||||||
//int gettimeofday(struct timeval *tv, void * tz);
|
//int gettimeofday(struct timeval *tv, void * tz);
|
||||||
|
//------------------------------------------------------------------------
|
||||||
void OsSupport::checkAlarms()
|
void OsSupport::checkAlarms()
|
||||||
{
|
{
|
||||||
struct timeval tm;
|
struct timeval tm;
|
||||||
|
@ -44,7 +44,11 @@ namespace System_
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
bool OsSupport::hasAlarms ()
|
||||||
|
{
|
||||||
|
return (s_Entries.size () != 0);
|
||||||
|
}
|
||||||
|
//------------------------------------------------------------------------
|
||||||
void OsSupport::cancelAlarms()
|
void OsSupport::cancelAlarms()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -284,6 +288,18 @@ __inline int gettimeofday(struct timeval *tv, struct timezone *tz)
|
||||||
{
|
{
|
||||||
OsSupport::checkAlarms();
|
OsSupport::checkAlarms();
|
||||||
}
|
}
|
||||||
|
else if (sig == SIGCHLD)
|
||||||
|
{
|
||||||
|
if (OsSupport::hasAlarms())
|
||||||
|
{
|
||||||
|
///
|
||||||
|
/// FIXME
|
||||||
|
///
|
||||||
|
/// there are expiriation alarms active and a child died unexpectly
|
||||||
|
/// lets commit suicide
|
||||||
|
exit(-2);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void OsSupport::setAlarm(long secs, OsSupport::ProcessID pid)
|
void OsSupport::setAlarm(long secs, OsSupport::ProcessID pid)
|
||||||
{
|
{
|
||||||
|
|
|
@ -120,6 +120,13 @@ namespace System_
|
||||||
|
|
||||||
static void checkAlarms();
|
static void checkAlarms();
|
||||||
|
|
||||||
|
///---------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
/// hasAlarms
|
||||||
|
///
|
||||||
|
/// Description: this function checks wether there are alarms set active
|
||||||
|
|
||||||
|
static bool hasAlarms();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//---------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue