summaryrefslogtreecommitdiff
path: root/src/common/thread.h
diff options
context:
space:
mode:
authorbrianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-12-05 02:53:33 +0000
committerbrianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-12-05 02:53:33 +0000
commit60a426c0742b3e7d8c5b557c7578df6eeeea377b (patch)
tree5d01f9ccc2798309f9b13f07c0096ed97c6a85c8 /src/common/thread.h
parent621db2441f69736a6c8f10d26bf966d5414fac74 (diff)
downloadhercules-60a426c0742b3e7d8c5b557c7578df6eeeea377b.tar.gz
hercules-60a426c0742b3e7d8c5b557c7578df6eeeea377b.tar.bz2
hercules-60a426c0742b3e7d8c5b557c7578df6eeeea377b.tar.xz
hercules-60a426c0742b3e7d8c5b557c7578df6eeeea377b.zip
- Undid r16968: SVN Replaced with source:/trunk/src/@16966 (tid:74924).
[16969:16991/trunk/src/] will be re-committed in the next 24 hours. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16992 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/thread.h')
-rw-r--r--src/common/thread.h62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/common/thread.h b/src/common/thread.h
index cfbfe689f..a5a66e954 100644
--- a/src/common/thread.h
+++ b/src/common/thread.h
@@ -1,19 +1,19 @@
// Copyright (c) rAthena Project (www.rathena.org) - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
-#pragma once
+#pragma once
#ifndef _rA_THREAD_H_
#define _rA_THREAD_H_
#include "../common/cbasetypes.h"
typedef struct rAthread *rAthread;
-typedef void *(*rAthreadProc)(void *);
+typedef void* (*rAthreadProc)(void*);
typedef enum RATHREAD_PRIO {
- RAT_PRIO_LOW = 0,
- RAT_PRIO_NORMAL,
- RAT_PRIO_HIGH
+ RAT_PRIO_LOW = 0,
+ RAT_PRIO_NORMAL,
+ RAT_PRIO_HIGH
} RATHREAD_PRIO;
@@ -22,51 +22,51 @@ typedef enum RATHREAD_PRIO {
*
* @param entyPoint - entryProc,
* @param param - general purpose parameter, would be given as parameter to the thread's entrypoint.
- *
+ *
* @return not NULL if success
*/
-rAthread rathread_create(rAthreadProc entryPoint, void *param);
+rAthread rathread_create( rAthreadProc entryPoint, void *param );
-/**
+/**
* Creates a new Thread (with more creation options)
*
* @param entyPoint - entryProc,
* @param param - general purpose parameter, would be given as parameter to the thread's entrypoint
- * @param szStack - stack Size in bytes
+ * @param szStack - stack Size in bytes
* @param prio - Priority of the Thread @ OS Scheduler..
*
* @return not NULL if success
*/
-rAthread rathread_createEx(rAthreadProc entryPoint, void *param, size_t szStack, RATHREAD_PRIO prio);
+rAthread rathread_createEx( rAthreadProc entryPoint, void *param, size_t szStack, RATHREAD_PRIO prio );
/**
* Destroys the given Thread immediatly
*
- * @note The Handle gets invalid after call! dont use it afterwards.
+ * @note The Handle gets invalid after call! dont use it afterwards.
*
* @param handle - thread to destroy.
*/
-void rathread_destroy(rAthread handle);
+void rathread_destroy ( rAthread handle );
-/**
+/**
* Returns the thread handle of the thread calling this function
- *
+ *
* @note this wont work @ programms main thread
- * @note the underlying implementation might not perform very well, cache the value received!
- *
+ * @note the underlying implementation might not perform very well, cache the value received!
+ *
* @return not NULL if success
*/
-rAthread rathread_self();
+rAthread rathread_self( );
/**
- * Returns own thrad id (TID)
+ * Returns own thrad id (TID)
*
- * @note this is an unique identifier for the calling thread, and
- * depends on platfrom / compiler, and may not be the systems Thread ID!
+ * @note this is an unique identifier for the calling thread, and
+ * depends on platfrom / compiler, and may not be the systems Thread ID!
*
* @return -1 when fails, otherwise >= 0
*/
@@ -74,39 +74,39 @@ int rathread_get_tid();
/**
- * Waits for the given thread to terminate
+ * Waits for the given thread to terminate
*
* @param handle - thread to wait (join) for
* @param out_Exitcode - [OPTIONAL] - if given => Exitcode (value) of the given thread - if it's terminated
- *
+ *
* @return true - if the given thread has been terminated.
*/
-bool rathread_wait(rAthread handle, void* *out_exitCode);
+bool rathread_wait( rAthread handle, void* *out_exitCode );
-/**
+/**
* Sets the given PRIORITY @ OS Task Scheduler
- *
+ *
* @param handle - thread to set prio for
* @param rio - the priority (RAT_PRIO_LOW ... )
*/
-void rathread_prio_set(rAthread handle, RATHREAD_PRIO prio);
+void rathread_prio_set( rAthread handle, RATHREAD_PRIO prio );
-/**
+/**
* Gets the current Prio of the given trhead
*
* @param handle - the thread to get the prio for.
*/
-RATHREAD_PRIO rathread_prio_get(rAthread handle);
+RATHREAD_PRIO rathread_prio_get( rAthread handle);
/**
* Tells the OS scheduler to yield the execution of the calling thread
- *
+ *
* @note: this will not "pause" the thread,
- * it just allows the OS to spent the remaining time
- * of the slice to another thread.
+ * it just allows the OS to spent the remaining time
+ * of the slice to another thread.
*/
void rathread_yield();