2002-10-01 11:22:11 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// This software is part of the OpenBeOS distribution and is covered
|
|
|
|
// by the OpenBeOS license.
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
/*!
|
|
|
|
\file RegistrarThreadManager.h
|
|
|
|
RegistrarThreadManager interface declaration
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef REGISTRAR_THREAD_MANAGER_H
|
|
|
|
#define REGISTRAR_THREAD_MANAGER_H
|
|
|
|
|
|
|
|
#include <Handler.h>
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
|
|
#include <list>
|
|
|
|
|
|
|
|
class RegistrarThread;
|
|
|
|
|
|
|
|
class RegistrarThreadManager : public BHandler {
|
|
|
|
public:
|
|
|
|
RegistrarThreadManager();
|
|
|
|
~RegistrarThreadManager();
|
|
|
|
|
|
|
|
// BHandler virtuals
|
|
|
|
virtual void MessageReceived(BMessage* message);
|
|
|
|
|
|
|
|
// Thread management functions
|
|
|
|
status_t LaunchThread(RegistrarThread *thread);
|
|
|
|
status_t CleanupThreads();
|
|
|
|
status_t ShutdownThreads();
|
|
|
|
status_t KillThreads();
|
|
|
|
|
|
|
|
uint ThreadCount() const;
|
|
|
|
|
|
|
|
static const uint kThreadLimit = 12;
|
2002-10-04 08:22:08 +04:00
|
|
|
private:
|
2002-10-01 11:22:11 +04:00
|
|
|
|
|
|
|
std::list<RegistrarThread*>::iterator& RemoveThread(std::list<RegistrarThread*>::iterator &i);
|
|
|
|
|
|
|
|
std::list<RegistrarThread*> fThreads;
|
|
|
|
uint fThreadCount;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // THREAD_MANAGER_H
|