xref: /freebsd/contrib/llvm-project/llvm/include/llvm/Support/Watchdog.h (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1 //===--- Watchdog.h - Watchdog timer ----------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 //  This file declares the llvm::sys::Watchdog class.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_SUPPORT_WATCHDOG_H
14 #define LLVM_SUPPORT_WATCHDOG_H
15 
16 #include "llvm/Support/Compiler.h"
17 
18 namespace llvm {
19   namespace sys {
20 
21     /// This class provides an abstraction for a timeout around an operation
22     /// that must complete in a given amount of time. Failure to complete before
23     /// the timeout is an unrecoverable situation and no mechanisms to attempt
24     /// to handle it are provided.
25     class Watchdog {
26     public:
27       Watchdog(unsigned int seconds);
28       ~Watchdog();
29     private:
30       // Noncopyable.
31       Watchdog(const Watchdog &other) = delete;
32       Watchdog &operator=(const Watchdog &other) = delete;
33     };
34   }
35 }
36 
37 #endif
38