Skip to content

Commit 31eca5d

Browse files
committed
Fix README ::thread:: usage
1 parent d85ba6a commit 31eca5d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ cmake .. && make && src/section_1/01_joinability
7979
- Programs having calls to `std::terminate` (aborts program) are referred as *unsafe*.
8080
- See: [example](src/section_1/01_joinability.cpp).
8181

82-
**Join Function** [std::thread::join()](https://en.cppreference.com/w/cpp/thread/thread/join):
82+
**Join Function** [join()](https://en.cppreference.com/w/cpp/thread/thread/join):
8383
- Introduces a *synchronization point* between the thread and the caller.
8484
- It blocks the execution of the caller, until the thread execution finishes.
8585

86-
**Detach function** [std::thread::detach()](https://en.cppreference.com/w/cpp/thread/thread/detach):
86+
**Detach function** [detach()](https://en.cppreference.com/w/cpp/thread/thread/detach):
8787
- Separates the thread from the thread object, allowing the thread to continue independenly.
8888
- Detached threads may outlive parents.
8989
- Detached threads are *non-joinable*, thus they can be safely destroyed.
@@ -98,16 +98,16 @@ cmake .. && make && src/section_1/01_joinability
9898
- RAII can be used to handle the thread resource and join when necessary.
9999
- See: [example](src/section_1/03_exceptions.cpp).
100100

101-
**Thread Constructor** [std::thread::thread()](https://en.cppreference.com/w/cpp/thread/thread/thread):
101+
**Thread Constructor** [thread()](https://en.cppreference.com/w/cpp/thread/thread/thread):
102102
- Default creates non-joinable thread.
103103
- Move enabled and Copy Disabled (see: [example](src/section_1/06_ownership.cpp)).
104104
- Class/Fn arguments are forwarded. Use `std::ref` to pass by reference. (see: [example](src/section_1/04_thread_parameters.cpp), [example](src/section_1/05_pass_by_ref_and_detach.cpp)).
105105

106106
**Useful API** ([example](src/section_1/07_useful_api.cpp)):
107-
- [std::thread::get_id()](https://en.cppreference.com/w/cpp/thread/thread/get_id): Unique id for *active* threads, contant otherwise. The type `std::thread::id` is designed to be used as a key in associative containers.
107+
- [get_id()](https://en.cppreference.com/w/cpp/thread/thread/get_id): Unique id for *active* threads, contant otherwise. The type `std::thread::id` is designed to be used as a key in associative containers.
108108
- [std::this_thread::sleep_for()](https://en.cppreference.com/w/cpp/thread/sleep_for): Blocks execution for *at least* the specified duration. It may block longer due to scheduling or resource contention delays.
109109
- [std::this_thread::yield()](https://en.cppreference.com/w/cpp/thread/yield): Hints the scheduler to allow other threads to run, and re-inserts the thread into the scheduling queue.
110-
- [std::thread::hardware_concurrency()](https://en.cppreference.com/w/cpp/thread/thread/hardware_concurrency): Returns the number of concurrent threads supported by the implementation (logical cores). The value should be considered only a hint.
110+
- [hardware_concurrency()](https://en.cppreference.com/w/cpp/thread/thread/hardware_concurrency): Returns the number of concurrent threads supported by the implementation (logical cores). The value should be considered only a hint.
111111
- [thread_local](https://en.cppreference.com/w/c/thread/thread_local): Macro specifying that a variable has thread-local storage duration; Each thread has its own, distinct, object. Initialization and destruction are bound to the thread.
112112

113113

0 commit comments

Comments
 (0)