28 #ifndef itkPlatformMultiThreader_h
29 #define itkPlatformMultiThreader_h
50 class ITKCommon_EXPORT PlatformMultiThreader :
public MultiThreaderBase
53 ITK_DISALLOW_COPY_AND_MOVE(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();
115 SingleMethodExecute()
override;
121 itkLegacyMacro(
void MultipleMethodExecute());
143 itkLegacyMacro(
void TerminateThread(
ThreadIdType thread_id));
146 SetMaximumNumberOfThreads(
ThreadIdType numberOfThreads)
override;
148 SetNumberOfWorkUnits(
ThreadIdType numberOfWorkUnits)
override;
150 struct WorkUnitInfo : MultiThreaderBase::WorkUnitInfo
152 int * ActiveFlag =
nullptr;
153 std::shared_ptr<std::mutex> ActiveFlagLock;
157 PlatformMultiThreader();
158 ~PlatformMultiThreader()
override;
160 PrintSelf(std::ostream & os, Indent indent)
const override;
171 std::shared_ptr<std::mutex> m_SpawnedThreadActiveFlagLock[
ITK_MAX_THREADS];
175 #if !defined(ITK_LEGACY_REMOVE)
185 SpawnDispatchSingleMethodThread(WorkUnitInfo *);