mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-26 09:58:16 +00:00
Merge pull request #2872 from jtojanen/master
Use critical section instead of mutex in Windows
This commit is contained in:
commit
92cf955ae6
@ -22,17 +22,17 @@
|
|||||||
#define hc_thread_exit(t) ExitThread (t)
|
#define hc_thread_exit(t) ExitThread (t)
|
||||||
#define hc_thread_detach(t) CloseHandle (t)
|
#define hc_thread_detach(t) CloseHandle (t)
|
||||||
|
|
||||||
/*
|
#define hc_thread_mutex_init(m) InitializeCriticalSection (&m)
|
||||||
#define hc_thread_mutex_lock(m) EnterCriticalSection (&m)
|
#define hc_thread_mutex_lock(m) EnterCriticalSection (&m)
|
||||||
#define hc_thread_mutex_unlock(m) LeaveCriticalSection (&m)
|
#define hc_thread_mutex_unlock(m) LeaveCriticalSection (&m)
|
||||||
#define hc_thread_mutex_init(m) InitializeCriticalSection (&m)
|
|
||||||
#define hc_thread_mutex_delete(m) DeleteCriticalSection (&m)
|
#define hc_thread_mutex_delete(m) DeleteCriticalSection (&m)
|
||||||
*/
|
|
||||||
|
|
||||||
|
/*
|
||||||
#define hc_thread_mutex_init(m) m = CreateMutex (NULL, FALSE, NULL)
|
#define hc_thread_mutex_init(m) m = CreateMutex (NULL, FALSE, NULL)
|
||||||
#define hc_thread_mutex_lock(m) WaitForSingleObject (m, INFINITE)
|
#define hc_thread_mutex_lock(m) WaitForSingleObject (m, INFINITE)
|
||||||
#define hc_thread_mutex_unlock(m) ReleaseMutex (m)
|
#define hc_thread_mutex_unlock(m) ReleaseMutex (m)
|
||||||
#define hc_thread_mutex_delete(m) CloseHandle (m)
|
#define hc_thread_mutex_delete(m) CloseHandle (m)
|
||||||
|
*/
|
||||||
|
|
||||||
#define hc_thread_sem_init(s) s = CreateSemaphore (NULL, 0, INT_MAX, NULL)
|
#define hc_thread_sem_init(s) s = CreateSemaphore (NULL, 0, INT_MAX, NULL)
|
||||||
#define hc_thread_sem_post(s) ReleaseSemaphore (s, 1, NULL)
|
#define hc_thread_sem_post(s) ReleaseSemaphore (s, 1, NULL)
|
||||||
|
@ -82,7 +82,7 @@ typedef struct timespec hc_timer_t;
|
|||||||
|
|
||||||
#if defined (_WIN)
|
#if defined (_WIN)
|
||||||
typedef HANDLE hc_thread_t;
|
typedef HANDLE hc_thread_t;
|
||||||
typedef HANDLE hc_thread_mutex_t;
|
typedef CRITICAL_SECTION hc_thread_mutex_t;
|
||||||
typedef HANDLE hc_thread_semaphore_t;
|
typedef HANDLE hc_thread_semaphore_t;
|
||||||
#else
|
#else
|
||||||
typedef pthread_t hc_thread_t;
|
typedef pthread_t hc_thread_t;
|
||||||
|
Loading…
Reference in New Issue
Block a user