1249259Sdim//===--- Watchdog.h - Watchdog timer ----------------------------*- C++ -*-===// 2249259Sdim// 3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4353358Sdim// See https://llvm.org/LICENSE.txt for license information. 5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6249259Sdim// 7249259Sdim//===----------------------------------------------------------------------===// 8249259Sdim// 9249259Sdim// This file declares the llvm::sys::Watchdog class. 10249259Sdim// 11249259Sdim//===----------------------------------------------------------------------===// 12249259Sdim 13249259Sdim#ifndef LLVM_SUPPORT_WATCHDOG_H 14249259Sdim#define LLVM_SUPPORT_WATCHDOG_H 15249259Sdim 16249259Sdim#include "llvm/Support/Compiler.h" 17249259Sdim 18249259Sdimnamespace llvm { 19249259Sdim namespace sys { 20249259Sdim 21249259Sdim /// This class provides an abstraction for a timeout around an operation 22249259Sdim /// that must complete in a given amount of time. Failure to complete before 23249259Sdim /// the timeout is an unrecoverable situation and no mechanisms to attempt 24249259Sdim /// to handle it are provided. 25249259Sdim class Watchdog { 26249259Sdim public: 27249259Sdim Watchdog(unsigned int seconds); 28249259Sdim ~Watchdog(); 29249259Sdim private: 30249259Sdim // Noncopyable. 31288943Sdim Watchdog(const Watchdog &other) = delete; 32288943Sdim Watchdog &operator=(const Watchdog &other) = delete; 33249259Sdim }; 34249259Sdim } 35249259Sdim} 36249259Sdim 37249259Sdim#endif 38