RAII guard installing the backend at startup and joining workers before main() exits. More...
#include <opencv_parallel.hpp>
Public Member Functions | |
| ScopedBackend () | |
| Ensure the OpenCV parallel backend is registered and enter a lifetime scope. | |
| ~ScopedBackend () | |
| Exit the scope and join idle worker threads when the outermost guard ends. | |
| ScopedBackend (const ScopedBackend &)=delete | |
| Noncopyable: each guard must pair one scope entry with one exit. | |
| ScopedBackend & | operator= (const ScopedBackend &)=delete |
| Nonassignable: a guard cannot transfer an active scope. | |
Private Attributes | |
| std::shared_ptr< ThreadPoolBackend > | backend_ |
Detailed Description
RAII guard installing the backend at startup and joining workers before main() exits.
Avoids leaving worker threads alive into static storage teardown in -static executables while still allowing unit tests without main() to call ensure_installed() directly.
Definition at line 443 of file opencv_parallel.hpp.
Constructor & Destructor Documentation
◆ ScopedBackend() [1/2]
|
inline |
Ensure the OpenCV parallel backend is registered and enter a lifetime scope.
Definition at line 446 of file opencv_parallel.hpp.
◆ ~ScopedBackend()
|
inline |
Exit the scope and join idle worker threads when the outermost guard ends.
Definition at line 449 of file opencv_parallel.hpp.
◆ ScopedBackend() [2/2]
|
delete |
Noncopyable: each guard must pair one scope entry with one exit.
Member Function Documentation
◆ operator=()
|
delete |
Nonassignable: a guard cannot transfer an active scope.
Field Documentation
◆ backend_
|
private |
Retained backend instance for symmetric scope exit.
Definition at line 457 of file opencv_parallel.hpp.
The documentation for this class was generated from the following file: