F.27: Example fix

It is usually a bad idea to share mutable objects between threads, which leads to a race condition or unnecessary thread contention.,
This commit is contained in:
Andriy Grygorenko 2015-11-27 20:19:32 -05:00
parent 105ff97910
commit 5990abead1

View File

@ -2583,7 +2583,7 @@ Using `std::shared_ptr` is the standard way to represent shared ownership. That
##### Example
shared_ptr<Image> im { read_image(somewhere) };
shared_ptr<const Image> im { read_image(somewhere) };
std::thread t0 {shade, args0, top_left, im};
std::thread t1 {shade, args1, top_right, im};