1 //===--- Watchdog.h - Watchdog timer ----------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file declares the llvm::sys::Watchdog class. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef LLVM_SUPPORT_WATCHDOG_H 15 #define LLVM_SUPPORT_WATCHDOG_H 16 17 #include "llvm/Support/Compiler.h" 18 19 namespace llvm { 20 namespace sys { 21 22 /// This class provides an abstraction for a timeout around an operation 23 /// that must complete in a given amount of time. Failure to complete before 24 /// the timeout is an unrecoverable situation and no mechanisms to attempt 25 /// to handle it are provided. 26 class Watchdog { 27 public: 28 Watchdog(unsigned int seconds); 29 ~Watchdog(); 30 private: 31 // Noncopyable. 32 Watchdog(const Watchdog &other) = delete; 33 Watchdog &operator=(const Watchdog &other) = delete; 34 }; 35 } 36 } 37 38 #endif 39