2009-02-08 21:10:57 +00:00
|
|
|
//===-- Alarm.inc - Implement Win32 Alarm Support ---------------*- C++ -*-===//
|
2005-12-22 03:23:46 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-12-22 03:23:46 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements the Win32 Alarm support.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
using namespace llvm;
|
|
|
|
|
2009-02-08 21:10:57 +00:00
|
|
|
/// NestedSOI - Sanity check. Alarms cannot be nested or run in parallel.
|
2005-12-22 03:23:46 +00:00
|
|
|
/// This ensures that they never do.
|
|
|
|
static bool NestedSOI = false;
|
|
|
|
|
|
|
|
void sys::SetupAlarm(unsigned seconds) {
|
|
|
|
assert(!NestedSOI && "sys::SetupAlarm calls cannot be nested!");
|
|
|
|
NestedSOI = true;
|
|
|
|
// FIXME: Implement for Win32
|
|
|
|
}
|
|
|
|
|
|
|
|
void sys::TerminateAlarm() {
|
|
|
|
assert(NestedSOI && "sys::TerminateAlarm called without sys::SetupAlarm!");
|
|
|
|
// FIXME: Implement for Win32
|
|
|
|
NestedSOI = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
int sys::AlarmStatus() {
|
|
|
|
// FIXME: Implement for Win32
|
|
|
|
return 0;
|
|
|
|
}
|
2009-02-08 22:47:39 +00:00
|
|
|
|
2009-02-12 07:39:10 +00:00
|
|
|
// Don't pull in all of the Windows headers.
|
2009-02-14 16:06:42 +00:00
|
|
|
extern "C" void __stdcall Sleep(unsigned long);
|
2009-02-12 07:39:10 +00:00
|
|
|
|
|
|
|
void sys::Sleep(unsigned n) {
|
2009-03-19 23:26:52 +00:00
|
|
|
::Sleep(n*1000);
|
2009-02-08 22:47:39 +00:00
|
|
|
}
|