Copyable mutexes


This feature is deprecated and will be removed in the future.

By default various implementations of mutexes are not copyable or movable (Prior to Intel® Threading Building Blocks 4.3 copying was possible for some of the mutex classes). If the macro TBB_DEPRECATED_MUTEX_COPYING is non-zero, it's possible to call assigment operators and copy constructors on mutexes.

C++11 forbids mutex types to be copyable or movable, so the old behavior is not compatible with the C++ standard.


Copying of a locked mutex, as well as copying concurrently with other operations on the same mutex, leads to undefined behavior.

See Also

For more complete information about compiler optimizations, see our Optimization Notice.