mirror of
git://git.qorg11.net/kill9.git
synced 2025-02-19 22:26:55 +00:00
one harmful thing about C++ is that the angle brackets sucks at pandoc :^)
This commit is contained in:
parent
7cc4619b13
commit
9d09e3cba4
@ -16,9 +16,9 @@ that the pthreads API are garbage. But C++'s threads API is much
|
||||
better:
|
||||
|
||||
<pre class="prettyprint">
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
|
||||
int j = 10;
|
||||
|
||||
@ -66,8 +66,8 @@ above you'll have to have a lot of patience to work with
|
||||
pthreads). but C++ does.
|
||||
|
||||
<pre class="prettyprint">
|
||||
#include <iostream>
|
||||
#include <future>
|
||||
#include <iostream>
|
||||
#include <future>
|
||||
|
||||
int
|
||||
do_stuff()
|
||||
@ -78,7 +78,7 @@ do_stuff()
|
||||
int
|
||||
main()
|
||||
{
|
||||
std::future<int> future = std::async(do_stuff);
|
||||
std::future<int> future = std::async(do_stuff);
|
||||
std::cout << "do_stuff() is being executed in the background" << std::endl;
|
||||
std::cout << "The return value of do_stuff is: " << future.get() << std::endl;
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user