summaryrefslogtreecommitdiff
path: root/src/common/thread.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-09-18 13:09:16 +0200
committerHaru <haru@dotalux.com>2015-09-25 12:55:36 +0200
commit1aea178ef7cdb76eda5600540b5fbd29fd54ff88 (patch)
tree855d4feafba212d7f36872c1b46814c1f1a85e75 /src/common/thread.c
parente99bf73af31a8b1f09b9ce033c16832ee5cac51d (diff)
downloadhercules-1aea178ef7cdb76eda5600540b5fbd29fd54ff88.tar.gz
hercules-1aea178ef7cdb76eda5600540b5fbd29fd54ff88.tar.bz2
hercules-1aea178ef7cdb76eda5600540b5fbd29fd54ff88.tar.xz
hercules-1aea178ef7cdb76eda5600540b5fbd29fd54ff88.zip
More aggressive whitespace cleanup. Follow up to 51329e6
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/thread.c')
-rw-r--r--src/common/thread.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/common/thread.c b/src/common/thread.c
index 9b9308d06..d5bbd7f97 100644
--- a/src/common/thread.c
+++ b/src/common/thread.c
@@ -48,12 +48,10 @@ struct rAthread {
#endif
};
-
#ifdef HAS_TLS
__thread int g_rathread_ID = -1;
#endif
-
///
/// Subystem Code
///
@@ -76,8 +74,6 @@ void rathread_init(void) {
}//end: rathread_init()
-
-
void rathread_final(void) {
register unsigned int i;
@@ -94,8 +90,6 @@ void rathread_final(void) {
}//end: rathread_final()
-
-
// gets called whenever a thread terminated ..
static void rat_thread_terminated(rAthread *handle) {
// Preserve handle->myID and handle->hThread, set everything else to its default value
@@ -131,7 +125,6 @@ static void *raThreadMainRedirector( void *p ){
#endif
-
ret = ((rAthread*)p)->proc( ((rAthread*)p)->param ) ;
#ifdef WIN32
@@ -146,10 +139,6 @@ static void *raThreadMainRedirector( void *p ){
#endif
}//end: raThreadMainRedirector()
-
-
-
-
///
/// API Level
///
@@ -157,7 +146,6 @@ rAthread *rathread_create(rAthreadProc entryPoint, void *param) {
return rathread_createEx( entryPoint, param, (1<<23) /*8MB*/, RAT_PRIO_NORMAL );
}//end: rathread_create()
-
rAthread *rathread_createEx(rAthreadProc entryPoint, void *param, size_t szStack, RATHREAD_PRIO prio) {
#ifndef WIN32
pthread_attr_t attr;
@@ -166,13 +154,11 @@ rAthread *rathread_createEx(rAthreadProc entryPoint, void *param, size_t szStack
unsigned int i;
rAthread *handle = NULL;
-
// given stacksize aligned to systems pagesize?
tmp = szStack % sysinfo->getpagesize();
if(tmp != 0)
szStack += tmp;
-
// Get a free Thread Slot.
for(i = 0; i < RA_THREADS_MAX; i++){
if(l_threads[i].proc == NULL){
@@ -208,7 +194,6 @@ rAthread *rathread_createEx(rAthreadProc entryPoint, void *param, size_t szStack
return handle;
}//end: rathread_createEx
-
void rathread_destroy(rAthread *handle) {
#ifdef WIN32
if( TerminateThread(handle->hThread, 0) != FALSE){
@@ -253,7 +238,6 @@ rAthread *rathread_self(void) {
return NULL;
}//end: rathread_self()
-
int rathread_get_tid(void) {
#ifdef HAS_TLS
@@ -269,7 +253,6 @@ int rathread_get_tid(void) {
}//end: rathread_get_tid()
-
bool rathread_wait(rAthread *handle, void **out_exitCode) {
// Hint:
// no thread data cleanup routine call here!
@@ -286,18 +269,15 @@ bool rathread_wait(rAthread *handle, void **out_exitCode) {
}//end: rathread_wait()
-
void rathread_prio_set(rAthread *handle, RATHREAD_PRIO prio) {
handle->prio = RAT_PRIO_NORMAL;
//@TODO
}//end: rathread_prio_set()
-
RATHREAD_PRIO rathread_prio_get(rAthread *handle) {
return handle->prio;
}//end: rathread_prio_get()
-
void rathread_yield(void) {
#ifdef WIN32
SwitchToThread();