Move RegistrarThread[Manager].cpp to the registrar. There was no point

in those living in libbe.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24603 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-03-27 02:51:58 +00:00
parent b6646cf8c0
commit 781a715529
8 changed files with 8 additions and 5 deletions
-45
View File
@@ -1,45 +0,0 @@
//----------------------------------------------------------------------
// This software is part of the OpenBeOS distribution and is covered
// by the OpenBeOS license.
//---------------------------------------------------------------------
/*!
\file RegistrarThread.h
RegistrarThread interface declaration
*/
#ifndef REGISTRAR_THREAD_H
#define REGISTRAR_THREAD_H
#include <Messenger.h>
#include <OS.h>
class RegistrarThread {
public:
RegistrarThread(const char *name, int32 priority, BMessenger managerMessenger);
virtual ~RegistrarThread();
virtual status_t InitCheck();
status_t Run();
thread_id Id() const;
const char* Name() const;
void AskToExit();
bool IsFinished() const;
protected:
//! The function executed in the object's thread when Run() is called
virtual status_t ThreadFunction() = 0;
BMessenger fManagerMessenger;
bool fShouldExit; // Initially false, may be set to true by AskToExit()
bool fIsFinished; // Initially false, set to true by the thread itself upon completion
private:
static int32 EntryFunction(void *data);
status_t fStatus;
thread_id fId;
char fName[B_OS_NAME_LENGTH];
};
#endif // REGISTRAR_THREAD_H
@@ -1,45 +0,0 @@
//----------------------------------------------------------------------
// 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;
private:
std::list<RegistrarThread*>::iterator& RemoveThread(std::list<RegistrarThread*>::iterator &i);
std::list<RegistrarThread*> fThreads;
uint fThreadCount;
};
#endif // THREAD_MANAGER_H