VTK  9.1.0
vtkThreadMessager.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkThreadMessager.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
23 #ifndef vtkThreadMessager_h
24 #define vtkThreadMessager_h
25 
26 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_1_0
27 
28 #include "vtkCommonSystemModule.h" // For export macro
29 #include "vtkObject.h"
30 #include "vtkThreads.h" // for VTK_USE_PTHREADS and VTK_USE_WIN32_THREADS
31 
32 #if defined(VTK_USE_PTHREADS)
33 #include <pthread.h> // Needed for pthread types
34 #endif
35 
37  "Use C++ STL threading classes") VTKCOMMONSYSTEM_EXPORT vtkThreadMessager : public vtkObject
38 {
39 public:
41 
42  vtkTypeMacro(vtkThreadMessager, vtkObject);
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
50 
56 
63 
70 
77 
78 protected:
80  ~vtkThreadMessager() override;
81 
82 #ifdef VTK_USE_PTHREADS
83  pthread_mutex_t Mutex;
84  pthread_cond_t PSignal;
85 #endif
86 
87 #ifdef VTK_USE_WIN32_THREADS
88  vtkWindowsHANDLE WSignal;
89 #endif
90 
91 private:
92  vtkThreadMessager(const vtkThreadMessager&) = delete;
93  void operator=(const vtkThreadMessager&) = delete;
94 };
95 
96 #endif
97 
98 // VTK-HeaderTest-Exclude: vtkThreadMessager.h
a simple class to control print indentation
Definition: vtkIndent.h:34
abstract base class for most VTK objects
Definition: vtkObject.h:63
A class for performing inter-thread messaging.
void DisableWaitForReceiver()
pthreads only.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkThreadMessager() override
void WaitForReceiver()
pthreads only.
void EnableWaitForReceiver()
pthreads only.
void SendWakeMessage()
Send a message to all threads who are waiting via WaitForMessage().
static vtkThreadMessager * New()
void WaitForMessage()
Wait (block, non-busy) until another thread sends a message.
#define VTK_DEPRECATED_IN_9_1_0(reason)