28 #ifndef itkPlatformMultiThreader_h
29 #define itkPlatformMultiThreader_h
50 class ITKCommon_EXPORT PlatformMultiThreader :
public MultiThreaderBase
53 ITK_DISALLOW_COPY_AND_ASSIGN(PlatformMultiThreader);
56 using Self = PlatformMultiThreader;
57 using Superclass = MultiThreaderBase;
58 using Pointer = SmartPointer<Self>;
59 using ConstPointer = SmartPointer<const Self>;
65 itkTypeMacro(PlatformMultiThreader, MultiThreaderBase);
67 #if !defined ( ITK_LEGACY_REMOVE )
73 itkLegacyMacro(
static void SetGlobalMaximumNumberOfThreads(
ThreadIdType val))
75 itkGenericOutputMacro(
"Warning: SetGlobalMaximumNumberOfThreads \
76 should now be called on itk::MultiThreaderBase. \
77 It can affect all MultiThreaderBase's derived classes in ITK");
78 Superclass::SetGlobalMaximumNumberOfThreads(val);
80 itkLegacyMacro(
static ThreadIdType GetGlobalMaximumNumberOfThreads())
82 itkGenericOutputMacro(
"Warning: GetGlobalMaximumNumberOfThreads \
83 should now be called on itk::MultiThreaderBase. \
84 It can affect all MultiThreaderBase's derived classes in ITK");
85 return Superclass::GetGlobalMaximumNumberOfThreads();
93 itkLegacyMacro(
static void SetGlobalDefaultNumberOfThreads(
ThreadIdType val))
95 itkGenericOutputMacro(
"Warning: SetGlobalDefaultNumberOfThreads \
96 should now be called on itk::MultiThreaderBase. \
97 It can affect all MultiThreaderBase's derived classes in ITK");
98 Superclass::SetGlobalDefaultNumberOfThreads(val);
100 itkLegacyMacro(
static ThreadIdType GetGlobalDefaultNumberOfThreads())
102 itkGenericOutputMacro(
"Warning: GetGlobalDefaultNumberOfThreads \
103 should now be called on itk::MultiThreaderBase. \
104 It can affect all MultiThreaderBase's derived classes in ITK");
105 return Superclass::GetGlobalDefaultNumberOfThreads();
114 void SingleMethodExecute()
override;
120 itkLegacyMacro(
void MultipleMethodExecute());
141 itkLegacyMacro(
void TerminateThread(
ThreadIdType thread_id));
143 virtual void SetMaximumNumberOfThreads(
ThreadIdType numberOfThreads )
override;
144 virtual void SetNumberOfWorkUnits(
ThreadIdType numberOfWorkUnits )
override;
146 struct WorkUnitInfo: MultiThreaderBase::WorkUnitInfo
149 std::shared_ptr< std::mutex > ActiveFlagLock;
153 PlatformMultiThreader();
154 ~PlatformMultiThreader()
override;
155 void PrintSelf(std::ostream & os, Indent indent)
const override;
166 std::shared_ptr< std::mutex >
171 #if !defined ( ITK_LEGACY_REMOVE )
void(* ThreadFunctionType)(void *)
constexpr std::vcl_size_t ITK_MAX_THREADS
unsigned int ThreadIdType