cppthread 1.1.16
C++ Thread Library
life.h
Go to the documentation of this file.
1// Copyright (c) 2013-2025 Made to Order Software Corp. All Rights Reserved
2//
3// https://snapwebsites.org/project/cppthread
4// contact@m2osw.com
5//
6// This program is free software; you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation; either version 2 of the License, or
9// (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License along
17// with this program; if not, write to the Free Software Foundation, Inc.,
18// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19#pragma once
20
33namespace cppthread
34{
35
36
37class thread;
38
39
40class life
41{
42public:
43 life(thread * const thread);
44 life(life const & rhs) = delete;
45 ~life();
46
47 life & operator = (life const & rhs) = delete;
48
49private:
50 thread * f_thread = nullptr;
51};
52
53
54
55} // namespace cppthread
56// vim: ts=4 sw=4 et
An RAII class managing the lifetime of a thread.
Definition life.h:41
thread * f_thread
The pointer to the thread being managed.
Definition life.h:50
life & operator=(life const &rhs)=delete
The assignment operator is deleted.
life(life const &rhs)=delete
The copy operator is deleted.
~life()
Make sure the thread stops.
Definition life.cpp:111
A thread object that ensures proper usage of system threads.
Definition thread.h:64

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.