summaryrefslogtreecommitdiff
path: root/src/common/mutex.c
diff options
context:
space:
mode:
authorblacksirius <blacksirius@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-06-11 21:51:09 +0000
committerblacksirius <blacksirius@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-06-11 21:51:09 +0000
commitb43920212e20b2169254b567266037f15485a02a (patch)
tree96e92a1ec01f27890796f2cce6ef7678e5177719 /src/common/mutex.c
parent7685ceccfe593b9b06492e8eadc7f0a1fe30076f (diff)
downloadhercules-b43920212e20b2169254b567266037f15485a02a.tar.gz
hercules-b43920212e20b2169254b567266037f15485a02a.tar.bz2
hercules-b43920212e20b2169254b567266037f15485a02a.tar.xz
hercules-b43920212e20b2169254b567266037f15485a02a.zip
Fixed bugreport:5989 map-server crashes.
Bug in Detail: - Uninitialized Critical Section used in Condition Variables.. - Possible Stack Overflow in async allocator Thread when build as Release Fixed by: - Initialize Critical Section for Condition Var's waiter count lock properly - Increased Stack Size of Async. Allocator Thread to 1MB (previously 512KB) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16269 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/mutex.c')
-rw-r--r--src/common/mutex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/mutex.c b/src/common/mutex.c
index 367574248..6b4f55119 100644
--- a/src/common/mutex.c
+++ b/src/common/mutex.c
@@ -133,6 +133,7 @@ racond racond_create(){
c->nWaiters = 0;
c->events[ EVENT_COND_SIGNAL ] = CreateEvent( NULL, FALSE, FALSE, NULL );
c->events[ EVENT_COND_BROADCAST ] = CreateEvent( NULL, TRUE, FALSE, NULL );
+ InitializeCriticalSection( &c->waiters_lock );
#else
pthread_cond_init(&c->hCond, NULL);
#endif
@@ -145,7 +146,7 @@ void racond_destroy( racond c ){
#ifdef WIN32
CloseHandle( c->events[ EVENT_COND_SIGNAL ] );
CloseHandle( c->events[ EVENT_COND_BROADCAST ] );
- InitializeCriticalSection( &c->waiters_lock );
+ DeleteCriticalSection( &c->waiters_lock );
#else
pthread_cond_destroy(&c->hCond);
#endif