Skip to content

Commit a53a96f

Browse files
committed
Update Thread class with new features. Update documentation.
1 parent 685888e commit a53a96f

11 files changed

Lines changed: 839 additions & 587 deletions

File tree

.github/workflows/cmake_clang.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ name: Clang
33
on:
44
push:
55
branches:
6-
- master # Trigger on push
6+
- master # Trigger on push
77
pull_request:
88
branches:
9-
- master # Trigger on pull
9+
- master # Trigger on pull
1010

1111
jobs:
1212
build:
1313
runs-on: ubuntu-latest # Use Ubuntu environment for the build
1414

1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@v2 # Checkout the repository code
17+
uses: actions/checkout@v4 # Checkout the repository code
1818

1919
- name: Configure CMake with Clang
2020
run: cmake -S . -B build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ # Configure CMake with Clang as the compiler

.github/workflows/cmake_ubuntu.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ name: Ubuntu
33
on:
44
push:
55
branches:
6-
- master # Trigger on push
6+
- master # Trigger on push
77
pull_request:
88
branches:
9-
- master # Trigger on pull
9+
- master # Trigger on pull
1010

1111
jobs:
1212
build:
1313
runs-on: ubuntu-latest # Use Ubuntu environment for the build
1414

1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@v2 # Checkout the repository code
17+
uses: actions/checkout@v4 # Checkout the repository code
1818

1919
- name: Configure CMake
20-
run: cmake -S . -B build # Configure CMake to generate build files in 'build' directory
20+
run: cmake -S . -B build # Configure CMake to generate build files in 'build' directory
2121

2222
- name: Build
2323
run: cmake --build build # Build the project using CMake

.github/workflows/cmake_windows.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ name: Windows
33
on:
44
push:
55
branches:
6-
- master # Trigger on push
6+
- master # Trigger on push
77
pull_request:
88
branches:
9-
- master # Trigger on pull
9+
- master # Trigger on pull
1010

1111
jobs:
1212
build:
1313
runs-on: windows-latest # Use Windows environment for the build
1414

1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@v2 # Checkout the repository code
17+
uses: actions/checkout@v4 # Checkout the repository code
1818

1919
- name: Set up Visual Studio
20-
uses: microsoft/setup-msbuild@v1.1 # Set up Visual Studio environment (MSBuild)
20+
uses: microsoft/setup-msbuild@v2 # Set up Visual Studio environment (MSBuild)
2121

2222
- name: Configure CMake
23-
run: cmake -S . -B build -G "Visual Studio 17 2022" # Configure CMake for Visual Studio
23+
run: cmake -S . -B build -G "Visual Studio 17 2022" # Configure CMake for Visual Studio
2424

2525
- name: Build
2626
run: cmake --build build --config Release # Build the project using CMake with Release configuration

CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,24 @@ cmake_minimum_required(VERSION 3.10)
1212
# Project name and language (C or C++)
1313
project(StdWorkerThread VERSION 1.0 LANGUAGES CXX)
1414

15+
# Require C++17 for std::optional and std::chrono features
16+
set(CMAKE_CXX_STANDARD 17)
17+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
18+
1519
# Collect all .cpp source files in the current directory
1620
file(GLOB SOURCES "${CMAKE_SOURCE_DIR}/*.cpp" "${CMAKE_SOURCE_DIR}/*.h")
1721

1822
# Add an executable target
1923
add_executable(StdWorkerThreadApp ${SOURCES})
2024

25+
# Set StdWorkerThreadApp as the default startup project in Visual Studio
26+
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT StdWorkerThreadApp)
27+
28+
# Link pthreads on Linux for thread naming support
29+
if(UNIX)
30+
target_link_libraries(StdWorkerThreadApp PRIVATE pthread)
31+
endif()
32+
33+
2134

2235

README.md

Lines changed: 220 additions & 239 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)