summaryrefslogtreecommitdiff
path: root/include/threadengines
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-23 18:48:32 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-23 18:48:32 +0000
commit7b6eae36661bc798f69b22393b85a4f06d533cf6 (patch)
tree60ac8fd2eb4f3e09530b3b634fce4ad5ce76e21f /include/threadengines
parent7f318a332523869a1abb7125c9fe9d09cc048409 (diff)
ThreadEngine: remove excessive mutex use on thread creation
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11249 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/threadengines')
-rw-r--r--include/threadengines/threadengine_pthread.h19
-rw-r--r--include/threadengines/threadengine_win32.h19
2 files changed, 18 insertions, 20 deletions
diff --git a/include/threadengines/threadengine_pthread.h b/include/threadengines/threadengine_pthread.h
index 4db1a6908..72fa1d219 100644
--- a/include/threadengines/threadengine_pthread.h
+++ b/include/threadengines/threadengine_pthread.h
@@ -23,21 +23,13 @@ class InspIRCd;
class CoreExport PThreadEngine : public ThreadEngine
{
- private:
-
- bool Mutex(bool enable);
-
public:
PThreadEngine(InspIRCd* Instance);
virtual ~PThreadEngine();
- void Run();
-
- static void* Entry(void* parameter);
-
- void Create(Thread* thread_to_init);
+ void Start(Thread* thread_to_init);
void FreeThread(Thread* thread);
@@ -56,12 +48,19 @@ class CoreExport ThreadEngineFactory : public classbase
}
};
+class CoreExport PThreadData : public ThreadData
+{
+ public:
+ pthread_t pthread_id;
+ void FreeThread(Thread* toFree);
+};
+
class CoreExport PosixMutex : public Mutex
{
private:
pthread_mutex_t putex;
public:
- PosixMutex(InspIRCd* Instance);
+ PosixMutex();
virtual void Enable(bool enable);
~PosixMutex();
};
diff --git a/include/threadengines/threadengine_win32.h b/include/threadengines/threadengine_win32.h
index d6d98b011..3388cead0 100644
--- a/include/threadengines/threadengine_win32.h
+++ b/include/threadengines/threadengine_win32.h
@@ -22,23 +22,15 @@ class InspIRCd;
class CoreExport Win32ThreadEngine : public ThreadEngine
{
- protected:
-
- bool Mutex(bool enable);
-
public:
Win32ThreadEngine(InspIRCd* Instance);
virtual ~Win32ThreadEngine();
- void Run();
-
static DWORD WINAPI Entry(void* parameter);
- void Create(Thread* thread_to_init);
-
- void FreeThread(Thread* thread);
+ void Start(Thread* thread_to_init);
const std::string GetName()
{
@@ -55,12 +47,19 @@ class CoreExport ThreadEngineFactory : public classbase
}
};
+class CoreExport Win32ThreadData : public ThreadData
+{
+ public:
+ HANDLE handle;
+ void FreeThread(Thread* toFree);
+};
+
class CoreExport Win32Mutex : public Mutex
{
private:
CRITICAL_SECTION wutex;
public:
- Win32Mutex(InspIRCd* Instance);
+ Win32Mutex();
virtual void Enable(bool enable);
~Win32Mutex();
};