Removed unused methods.
This commit is contained in:
parent
a665f4dd46
commit
482a386e68
@ -131,7 +131,6 @@ Thread::~Thread()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// initialize Thread's class static member
|
// initialize Thread's class static member
|
||||||
Thread::ThreadStorage *Thread::m_ThreadStorage = NULL;
|
|
||||||
ThreadPriority Thread::m_TpEnum;
|
ThreadPriority Thread::m_TpEnum;
|
||||||
|
|
||||||
bool Thread::start()
|
bool Thread::start()
|
||||||
@ -142,8 +141,6 @@ bool Thread::start()
|
|||||||
// incRef before spawing the thread, otherwise Thread::ThreadTask() might call decRef and delete m_task
|
// incRef before spawing the thread, otherwise Thread::ThreadTask() might call decRef and delete m_task
|
||||||
m_task->incReference();
|
m_task->incReference();
|
||||||
|
|
||||||
m_ThreadStorage = new ACE_TSS<Thread>();
|
|
||||||
|
|
||||||
bool res = (ACE_Thread::spawn(&Thread::ThreadTask, (void*)m_task, THREADFLAG, &m_iThreadId, &m_hThreadHandle) == 0);
|
bool res = (ACE_Thread::spawn(&Thread::ThreadTask, (void*)m_task, THREADFLAG, &m_iThreadId, &m_hThreadHandle) == 0);
|
||||||
|
|
||||||
if (res)
|
if (res)
|
||||||
@ -162,8 +159,6 @@ bool Thread::wait()
|
|||||||
|
|
||||||
m_iThreadId = 0;
|
m_iThreadId = 0;
|
||||||
m_hThreadHandle = 0;
|
m_hThreadHandle = 0;
|
||||||
delete m_ThreadStorage;
|
|
||||||
m_ThreadStorage = NULL;
|
|
||||||
|
|
||||||
return (_res == 0);
|
return (_res == 0);
|
||||||
}
|
}
|
||||||
@ -178,8 +173,6 @@ void Thread::destroy()
|
|||||||
|
|
||||||
m_iThreadId = 0;
|
m_iThreadId = 0;
|
||||||
m_hThreadHandle = 0;
|
m_hThreadHandle = 0;
|
||||||
delete m_ThreadStorage;
|
|
||||||
m_ThreadStorage = NULL;
|
|
||||||
|
|
||||||
// reference set at ACE_Thread::spawn
|
// reference set at ACE_Thread::spawn
|
||||||
m_task->decReference();
|
m_task->decReference();
|
||||||
@ -208,35 +201,6 @@ ACE_THR_FUNC_RETURN Thread::ThreadTask(void* param)
|
|||||||
return (ACE_THR_FUNC_RETURN)0;
|
return (ACE_THR_FUNC_RETURN)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ACE_thread_t Thread::currentId()
|
|
||||||
{
|
|
||||||
return ACE_Thread::self();
|
|
||||||
}
|
|
||||||
|
|
||||||
ACE_hthread_t Thread::currentHandle()
|
|
||||||
{
|
|
||||||
ACE_hthread_t _handle;
|
|
||||||
ACE_Thread::self(_handle);
|
|
||||||
|
|
||||||
return _handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
Thread* Thread::current()
|
|
||||||
{
|
|
||||||
Thread* _thread = (*m_ThreadStorage).ts_object();
|
|
||||||
if (!_thread)
|
|
||||||
{
|
|
||||||
_thread = new Thread();
|
|
||||||
_thread->m_iThreadId = Thread::currentId();
|
|
||||||
_thread->m_hThreadHandle = Thread::currentHandle();
|
|
||||||
|
|
||||||
Thread* _oldValue = (*m_ThreadStorage).ts_object(_thread);
|
|
||||||
delete _oldValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _thread;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Thread::setPriority(Priority type)
|
void Thread::setPriority(Priority type)
|
||||||
{
|
{
|
||||||
#ifndef __sun__
|
#ifndef __sun__
|
||||||
|
@ -175,24 +175,6 @@ namespace ACE_Based
|
|||||||
* @param msecs
|
* @param msecs
|
||||||
*/
|
*/
|
||||||
static void Sleep(unsigned long msecs);
|
static void Sleep(unsigned long msecs);
|
||||||
/**
|
|
||||||
* @brief
|
|
||||||
*
|
|
||||||
* @return ACE_thread_t
|
|
||||||
*/
|
|
||||||
static ACE_thread_t currentId();
|
|
||||||
/**
|
|
||||||
* @brief
|
|
||||||
*
|
|
||||||
* @return ACE_hthread_t
|
|
||||||
*/
|
|
||||||
static ACE_hthread_t currentHandle();
|
|
||||||
/**
|
|
||||||
* @brief
|
|
||||||
*
|
|
||||||
* @return Thread
|
|
||||||
*/
|
|
||||||
static Thread* current();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
@ -225,8 +207,6 @@ namespace ACE_Based
|
|||||||
* @brief
|
* @brief
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
typedef ACE_TSS<Thread> ThreadStorage;
|
|
||||||
static ThreadStorage *m_ThreadStorage; /**< global object - container for Thread class representation of every thread */
|
|
||||||
static ThreadPriority m_TpEnum; /**< use this object to determine current OS thread priority values mapped to enum Priority{} */
|
static ThreadPriority m_TpEnum; /**< use this object to determine current OS thread priority values mapped to enum Priority{} */
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user