Destroy wait conditions before exiting

We already do this for locks. Also rename SitIdleEvent
in WaitCond to be uniform with Lunix naming.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2010-10-17 08:16:46 +01:00
parent 1fdb436e78
commit 3a564ed5db
2 changed files with 14 additions and 17 deletions
+5 -2
View File
@@ -27,12 +27,13 @@
# include <pthread.h>
typedef pthread_mutex_t Lock;
typedef pthread_cond_t WaitCondition;
# define lock_init(x) pthread_mutex_init(x, NULL)
# define lock_grab(x) pthread_mutex_lock(x)
# define lock_release(x) pthread_mutex_unlock(x)
# define lock_destroy(x) pthread_mutex_destroy(x)
# define cond_destroy(x) pthread_cond_destroy(x);
#else
@@ -41,11 +42,13 @@ typedef pthread_mutex_t Lock;
#undef WIN32_LEAN_AND_MEAN
typedef CRITICAL_SECTION Lock;
typedef HANDLE WaitCondition;
# define lock_init(x) InitializeCriticalSection(x)
# define lock_grab(x) EnterCriticalSection(x)
# define lock_release(x) LeaveCriticalSection(x)
# define lock_destroy(x) DeleteCriticalSection(x)
# define cond_destroy(x) CloseHandle(*x);
#endif