cppthread 1.1.16
C++ Thread Library
show_threads.cpp
1// Copyright (c) 2020-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
20// cppthread
21//
22#include <cppthread/thread.h>
23
24
25// libexcept
26//
27#include <libexcept/file_inheritance.h>
28
29
30// C++
31//
32#include <iostream>
33
34
35// last include
36//
37#include <snapdev/poison.h>
38
39
40
41int main(int argc, char * argv[])
42{
43 libexcept::verify_inherited_files();
44
45 for(int i(1); i < argc; ++i)
46 {
47 cppthread::process_ids_t pids(cppthread::is_process_running(atoi(argv[i])));
48 for(auto p : pids)
49 {
50 std::cout << p << " ";
51 }
52 std::cout << "\n";
53 }
54
55 return 0;
56}
57
58// vim: ts=4 sw=4 et
Thread Runner and Managers.
std::vector< pid_t > process_ids_t
A list of identifiers representing various processes.
Definition thread.h:125

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.