LLVM API Documentation
00001 //===-- Alarm.inc - Implement Win32 Alarm Support ---------------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file implements the Win32 Alarm support. 00011 // 00012 //===----------------------------------------------------------------------===// 00013 00014 #include <cassert> 00015 using namespace llvm; 00016 00017 /// NestedSOI - Sanity check. Alarms cannot be nested or run in parallel. 00018 /// This ensures that they never do. 00019 static bool NestedSOI = false; 00020 00021 void sys::SetupAlarm(unsigned seconds) { 00022 assert(!NestedSOI && "sys::SetupAlarm calls cannot be nested!"); 00023 NestedSOI = true; 00024 // FIXME: Implement for Win32 00025 } 00026 00027 void sys::TerminateAlarm() { 00028 assert(NestedSOI && "sys::TerminateAlarm called without sys::SetupAlarm!"); 00029 // FIXME: Implement for Win32 00030 NestedSOI = false; 00031 } 00032 00033 int sys::AlarmStatus() { 00034 // FIXME: Implement for Win32 00035 return 0; 00036 } 00037 00038 // Don't pull in all of the Windows headers. 00039 extern "C" void __stdcall Sleep(unsigned long); 00040 00041 void sys::Sleep(unsigned n) { 00042 ::Sleep(n*1000); 00043 }