microsoft / microsoft/vscode-cpptools

Replace pthreads in multithreaded sample with standard C++11 <thread>

Offen
#13,732 1 Kommentar 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@Subham-KRLX arbeitet bereits daran.

Seit 27.6.2025.

bug
Vorherrschende Sprache
TypeScript
Sterne
6.2k
Forks
1.7k
Ø Merge
14 Std. 46 Min.
Gemergte PRs (30 T.)
61

Beschreibung

Problem

In PR #13702 it was decided to retain build.cmd for Windows, since that's not actually the root issue. The real limitation is the use of pthreads in the multithreaded sample, which restricts cross-platform compatibility.

Proposal

  • Update the multithreaded example to use C++11 <thread> instead of pthreads
  • Remove direct pthread dependencies in the sample code
  • Adjust build scripts or CMake/Makefiles to avoid needing -pthread
  • Ensure the sample builds and runs consistently on Windows, macOS, and Linux without extra libraries or flags

Benefits

  • Enables true cross-platform support out of the box
  • Simplifies build system and reduces dependency overhead
  • Demonstrates modern C++ best practices in the sample

References:

  • Initial PR & discussion: #13702

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.