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;
58 using Pointer = SmartPointer<Self>;
65 itkOverrideGetNameOfClassMacro(PlatformMultiThreader);
67 #if !defined(ITK_LEGACY_REMOVE)
73 itkLegacyMacro(
static void SetGlobalMaximumNumberOfThreads(
ThreadIdType val))
75 itkGenericOutputMacro(
"Warning: SetGlobalMaximumNumberOfThreads should now be called on itk::MultiThreaderBase. It "
76 "can affect all MultiThreaderBase's derived classes in ITK");
77 Superclass::SetGlobalMaximumNumberOfThreads(val);
79 itkLegacyMacro(
static ThreadIdType GetGlobalMaximumNumberOfThreads())
81 itkGenericOutputMacro(
"Warning: GetGlobalMaximumNumberOfThreads should now be called on itk::MultiThreaderBase. It "
82 "can affect all MultiThreaderBase's derived classes in ITK");
83 return Superclass::GetGlobalMaximumNumberOfThreads();
91 itkLegacyMacro(
static void SetGlobalDefaultNumberOfThreads(
ThreadIdType val))
93 itkGenericOutputMacro(
"Warning: SetGlobalDefaultNumberOfThreads should now be called on itk::MultiThreaderBase. It "
94 "can affect all MultiThreaderBase's derived classes in ITK");
95 Superclass::SetGlobalDefaultNumberOfThreads(val);
97 itkLegacyMacro(
static ThreadIdType GetGlobalDefaultNumberOfThreads())
99 itkGenericOutputMacro(
"Warning: GetGlobalDefaultNumberOfThreads should now be called on itk::MultiThreaderBase. It "
100 "can affect all MultiThreaderBase's derived classes in ITK");
101 return Superclass::GetGlobalDefaultNumberOfThreads();
111 SingleMethodExecute()
override;
117 itkLegacyMacro(
void MultipleMethodExecute();)
139 itkLegacyMacro(
void TerminateThread(
ThreadIdType thread_id);)
142 SetMaximumNumberOfThreads(
ThreadIdType numberOfThreads)
override;
144 SetNumberOfWorkUnits(
ThreadIdType numberOfWorkUnits)
override;
146 struct WorkUnitInfo : MultiThreaderBase::WorkUnitInfo
148 int * ActiveFlag =
nullptr;
149 std::shared_ptr<std::mutex> ActiveFlagLock;
153 PlatformMultiThreader();
154 ~PlatformMultiThreader()
override;
156 PrintSelf(std::ostream & os, Indent indent)
const override;
167 std::shared_ptr<std::mutex> m_SpawnedThreadActiveFlagMutex[
ITK_MAX_THREADS]{};
171 #if !defined(ITK_LEGACY_REMOVE)
181 SpawnDispatchSingleMethodThread(WorkUnitInfo *);