跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[C++] c++多线程如何配置环境看线程的调试信息

发表于

用的是 vscode+cmake,debug 的方式是配置 Launch.jsontasks.json 执行 cmake 构建命令并运行可执行文件。 现在遇到的问题是:不知道怎么查看多线程中多个线程的调试信息。 我在网上看见给命令加-pthread的,以下是我的CMakeLists.txt文件

cmake_minimum_required(VERSION 3.10)

# 添加了 -pthread
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20 -pthread")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c17")
project(thread-pool)
set(HOME ${CMAKE_CURRENT_SOURCE_DIR})
set(EXECUTABLE_OUTPUT_PATH ${HOME}/bin)


include_directories(${HOME}/include)

link_directories(${HOME}/bin)
aux_source_directory(${HOME}/src SRC_PATH)

add_executable(app ${SRC_PATH})

target_link_libraries(app PUBLIC pthread)

结果 vscode 中还是看不到多个线程的调试信息。 大手子都是怎么看多线程调试信息的?

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.