From 64139523d4a6be8ef75921e08af2e93945d9d198 Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Mon, 28 Dec 2015 21:17:09 -0800 Subject: [PATCH] - attempt to inline some mutex funcrtiosn for beter performance --- source/shared_lib/include/platform/sdl/thread.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/shared_lib/include/platform/sdl/thread.h b/source/shared_lib/include/platform/sdl/thread.h index 744c25966..53f9aef71 100644 --- a/source/shared_lib/include/platform/sdl/thread.h +++ b/source/shared_lib/include/platform/sdl/thread.h @@ -134,16 +134,16 @@ private: public: Mutex(string ownerId=""); ~Mutex(); - void setOwnerId(string ownerId) { + inline void setOwnerId(string ownerId) { if(this->ownerId != ownerId) { this->ownerId = ownerId; } } void p(); void v(); - int getRefCount() const { return refCount; } + inline int getRefCount() const { return refCount; } - SDL_mutex* getMutex() { return mutex; } + inline SDL_mutex* getMutex() { return mutex; } }; class MutexSafeWrapper { @@ -167,18 +167,18 @@ public: ReleaseLock(); } - void setMutex(Mutex *mutex,string ownerId="") { + inline void setMutex(Mutex *mutex,string ownerId="") { this->mutex = mutex; if(this->ownerId != ownerId) { this->ownerId = ownerId; } Lock(); } - bool isValidMutex() const { + inline bool isValidMutex() const { return(this->mutex != NULL); } - void Lock() { + inline void Lock() { if(this->mutex != NULL) { #ifdef DEBUG_MUTEXES if(this->ownerId != "") { @@ -207,7 +207,7 @@ public: #endif } } - void ReleaseLock(bool keepMutex=false,bool deleteMutexOnRelease=false) { + inline void ReleaseLock(bool keepMutex=false,bool deleteMutexOnRelease=false) { if(this->mutex != NULL) { #ifdef DEBUG_MUTEXES if(this->ownerId != "") {