summaryrefslogtreecommitdiff
path: root/src/common/mutex.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-07-10 15:38:09 +0200
committerHaru <haru@dotalux.com>2014-07-11 08:42:50 +0200
commit8b4f35532c8fd7c7f0939756923fdaf14ee39531 (patch)
tree2a5a69e909538ecc81cdcd37b0dd74e0a046e021 /src/common/mutex.h
parent3f3f2e7ec09087b57148a0fb229de26293c5a462 (diff)
downloadhercules-8b4f35532c8fd7c7f0939756923fdaf14ee39531.tar.gz
hercules-8b4f35532c8fd7c7f0939756923fdaf14ee39531.tar.bz2
hercules-8b4f35532c8fd7c7f0939756923fdaf14ee39531.tar.xz
hercules-8b4f35532c8fd7c7f0939756923fdaf14ee39531.zip
Removed unsafe pointer typedefs
- If a variable doesn't look like a pointer... Maybe it might be a pointer after all. Please, give me back my '*' sign. - See CERT DCL05-C. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/mutex.h')
-rw-r--r--src/common/mutex.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/common/mutex.h b/src/common/mutex.h
index ce13a28b7..ced91ab8e 100644
--- a/src/common/mutex.h
+++ b/src/common/mutex.h
@@ -6,29 +6,29 @@
#include "../common/cbasetypes.h"
-typedef struct ramutex *ramutex; // Mutex
-typedef struct racond *racond; // Condition Var
+typedef struct ramutex ramutex; // Mutex
+typedef struct racond racond; // Condition Var
/**
* Creates a Mutex
*
* @return not NULL
*/
-ramutex ramutex_create();
+ramutex *ramutex_create();
/**
* Destroys a Mutex
*
* @param m - the mutex to destroy
*/
-void ramutex_destroy( ramutex m );
+void ramutex_destroy(ramutex *m);
/**
* Gets a lock
*
* @param m - the mutex to lock
*/
-void ramutex_lock( ramutex m);
+void ramutex_lock(ramutex *m);
/**
* Trys to get the Lock
@@ -37,14 +37,14 @@ void ramutex_lock( ramutex m);
*
* @return boolean (true = got the lock)
*/
-bool ramutex_trylock( ramutex m );
+bool ramutex_trylock(ramutex *m);
/**
* Unlocks a mutex
*
* @param m - the mutex to unlock
*/
-void ramutex_unlock( ramutex m);
+void ramutex_unlock(ramutex *m);
/**
@@ -52,14 +52,14 @@ void ramutex_unlock( ramutex m);
*
* @return not NULL
*/
-racond racond_create();
+racond *racond_create();
/**
* Destroy a Condition variable
*
* @param c - the condition variable to destroy
*/
-void racond_destroy( racond c );
+void racond_destroy(racond *c);
/**
* Waits Until state is signaled
@@ -68,7 +68,7 @@ void racond_destroy( racond c );
* @param m - the mutex used for synchronization
* @param timeout_ticks - timeout in ticks ( -1 = INFINITE )
*/
-void racond_wait( racond c, ramutex m, sysint timeout_ticks);
+void racond_wait(racond *c, ramutex *m, sysint timeout_ticks);
/**
* Sets the given condition var to signaled state
@@ -78,7 +78,7 @@ void racond_wait( racond c, ramutex m, sysint timeout_ticks);
* @note:
* Only one waiter gets notified.
*/
-void racond_signal( racond c );
+void racond_signal(racond *c);
/**
* Sets notifies all waiting threads thats signaled.
@@ -87,7 +87,7 @@ void racond_signal( racond c );
* @note:
* All Waiters getting notified.
*/
-void racond_broadcast( racond c );
+void racond_broadcast(racond *c);
#endif /* _COMMON_MUTEX_H_ */