Kea 1.5.0
thread.h
Go to the documentation of this file.
1// Copyright (C) 2012-2018 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef KEA_THREAD_H
8#define KEA_THREAD_H
9
11
12#include <boost/noncopyable.hpp>
13#include <boost/function.hpp>
14
15namespace isc {
16namespace util {
22namespace thread {
23
36class Thread : public boost::noncopyable {
37public:
44 public:
45 UncaughtException(const char* file, size_t line, const char* what) :
46 Exception(file, line, what)
47 {}
48 };
49
70 Thread(const boost::function<void()>& main);
71
82 ~Thread();
83
94 void wait();
95private:
96 class Impl;
97 Impl* impl_;
98};
99
101typedef boost::shared_ptr<Thread> ThreadPtr;
102
103}
104}
105}
106
107#endif
int main(int argc, char *argv[])
Definition: agent/main.cc:16
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
There's an uncaught exception in a thread.
Definition: thread.h:43
UncaughtException(const char *file, size_t line, const char *what)
Definition: thread.h:45
A separate thread.
Definition: thread.h:36
void wait()
Wait for the thread to terminate.
Definition: thread.cc:156
~Thread()
Destructor.
Definition: thread.cc:144
boost::shared_ptr< Thread > ThreadPtr
Thread pointer type.
Definition: thread.h:101
Defines the logger used by the top-level component of kea-dhcp-ddns.