concept calling thread in category c++

appears as: calling thread, The calling thread
C++ Concurrency in Action, Second Edition

This is an excerpt from Manning's book C++ Concurrency in Action, Second Edition.

First up, you have the call to distance 2, which performs operations on the user-supplied iterator type. Because you haven’t yet done any work, and this is on the calling thread, it’s fine. Next up, you have the allocation of the results vector 3 and the threads vector 4. Again, these are on the calling thread, and you haven’t done any work or spawned any threads, so this is fine. If the construction of threads throws, the memory allocated for results will have to be cleaned up, but the destructor will take care of that for you.

  • Preconditions lock.owns_lock() is true, and the lock is owned by the calling thread.