Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef NUM_THREADS_MONITOR_H
00014 #define NUM_THREADS_MONITOR_H
00015
00016 #include "ace/pre.h"
00017
00018 #include "ace/Monitor_Base.h"
00019
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 #pragma once
00022 #endif
00023
00024 #if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
00025
00026 #if defined (ACE_HAS_PDH_H) && !defined (ACE_LACKS_PDH_H)
00027 #include "ace/Monitor_Control/Windows_Monitor.h"
00028 #elif defined (ACE_HAS_KSTAT)
00029
00030
00031
00032
00033
00034
00035
00036 #endif
00037
00038 #include "ace/Monitor_Control/Monitor_Control_export.h"
00039
00040 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00041
00042 namespace ACE
00043 {
00044 namespace Monitor_Control
00045 {
00046
00047
00048
00049
00050
00051 class MONITOR_CONTROL_Export Num_Threads_Monitor
00052 : public Monitor_Base
00053 #if defined (ACE_HAS_WIN32_PDH)
00054 , public Windows_Monitor
00055 #endif
00056 {
00057 public:
00058 Num_Threads_Monitor (const char* name);
00059
00060
00061 virtual void update (void);
00062
00063
00064 static const char* default_name (void);
00065
00066 private:
00067
00068 virtual void clear_i (void);
00069
00070 private:
00071 static const char* default_name_;
00072
00073 #if defined (linux)
00074 FILE *file_ptr_;
00075 char buf_[1024];
00076 unsigned long nthreads_;
00077 #endif
00078 };
00079 }
00080 }
00081
00082 ACE_END_VERSIONED_NAMESPACE_DECL
00083
00084 #endif
00085
00086 #include "ace/post.h"
00087
00088 #endif // NUM_THREADS_MONITOR_H