Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ set_target_properties(concurrencpp PROPERTIES
SOVERSION "${PROJECT_VERSION_MAJOR}"
)

set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX "d")

target_coroutine_options(concurrencpp)

target_compile_definitions(concurrencpp
Expand Down
1 change: 1 addition & 0 deletions include/concurrencpp/results/impl/shared_result_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "concurrencpp/results/impl/result_state.h"

#include <atomic>
#include <chrono>
#include <semaphore>

#include <cassert>
Expand Down
2 changes: 1 addition & 1 deletion include/concurrencpp/results/result.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace concurrencpp {
template<class type>
class result {
class [[nodiscard]] result {

static constexpr auto valid_result_type_v = std::is_same_v<type, void> || std::is_nothrow_move_constructible_v<type>;

Expand Down
1 change: 1 addition & 0 deletions include/concurrencpp/threads/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "concurrencpp/platform_defs.h"

#include <functional>
#include <string>
#include <string_view>
#include <thread>

Expand Down
12 changes: 9 additions & 3 deletions source/threads/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,17 @@ size_t thread::hardware_concurrency() noexcept {
#ifdef CRCPP_WIN_OS

# include <Windows.h>
# include <VersionHelpers.h>

void thread::set_name(std::string_view name) noexcept {
const std::wstring utf16_name(name.begin(),
name.end()); // concurrencpp strings are always ASCII (english only)
::SetThreadDescription(::GetCurrentThread(), utf16_name.data());
if (IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN10), LOBYTE(_WIN32_WINNT_WIN10), 14393)) {
// Windows 10 1607 or greater, use SetThreadDescription
const std::wstring utf16_name(name.begin(),
name.end()); // concurrencpp strings are always ASCII (english only)
::SetThreadDescription(::GetCurrentThread(), utf16_name.c_str());
} else {
// Windows version is less than Windows 10, do nothing
}
}

#elif defined(CRCPP_MINGW_OS)
Expand Down