Eluna add mutex lock for hook calls

This commit is contained in:
Rochet2
2015-01-03 22:20:30 +02:00
parent 5bf5b11c6f
commit 092c61c20b
3 changed files with 14 additions and 0 deletions

View File

@@ -116,6 +116,16 @@ public:
static bool reload;
static bool initialized;
#ifdef TRINITY
typedef std::recursive_mutex LockType;
typedef std::lock_guard<LockType> ElunaGuard;
#else
typedef ACE_Recursive_Thread_Mutex LockType;
typedef ACE_Guard<LockType> ElunaGuard;
#endif
LockType elunaLock;
lua_State* L;
uint32 event_level;
@@ -391,4 +401,5 @@ template<> WorldObject* Eluna::CHECKOBJ<WorldObject>(lua_State* L, int narg, boo
template<> ElunaObject* Eluna::CHECKOBJ<ElunaObject>(lua_State* L, int narg, bool error);
#define sEluna Eluna::GEluna
#define ELUNA_LOCK(E) Eluna::ElunaGuard elunaGuard((E)->elunaLock);
#endif