1 //---------------------------------------------------------------------- 2 // This software is part of the Haiku distribution and is covered 3 // by the MIT License. 4 //--------------------------------------------------------------------- 5 /*! 6 \file RegistrarThreadManager.h 7 RegistrarThreadManager interface declaration 8 */ 9 10 #ifndef REGISTRAR_THREAD_MANAGER_H 11 #define REGISTRAR_THREAD_MANAGER_H 12 13 #include <Handler.h> 14 #include <SupportDefs.h> 15 16 #include <list> 17 18 class RegistrarThread; 19 20 class RegistrarThreadManager : public BHandler { 21 public: 22 RegistrarThreadManager(); 23 ~RegistrarThreadManager(); 24 25 // BHandler virtuals 26 virtual void MessageReceived(BMessage* message); 27 28 // Thread management functions 29 status_t LaunchThread(RegistrarThread *thread); 30 status_t CleanupThreads(); 31 status_t ShutdownThreads(); 32 status_t KillThreads(); 33 34 uint ThreadCount() const; 35 36 static const int kThreadLimit = 12; 37 private: 38 39 std::list<RegistrarThread*>::iterator& 40 RemoveThread(std::list<RegistrarThread*>::iterator &i); 41 42 std::list<RegistrarThread*> fThreads; 43 int32 fThreadCount; 44 }; 45 46 #endif // THREAD_MANAGER_H 47