diff options
author | kikht <kikht@yandex-team.ru> | 2022-02-10 16:45:14 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:14 +0300 |
commit | 194cae0e8855b11be2005e1eff12c660c3ee9774 (patch) | |
tree | ed29c437b616690880c017855ebe0be34fdf81a2 /contrib/libs/libevent/evthread_win32.c | |
parent | 49116032d905455a7b1c994e4a696afc885c1e71 (diff) | |
download | ydb-194cae0e8855b11be2005e1eff12c660c3ee9774.tar.gz |
Restoring authorship annotation for <kikht@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/libevent/evthread_win32.c')
-rw-r--r-- | contrib/libs/libevent/evthread_win32.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/contrib/libs/libevent/evthread_win32.c b/contrib/libs/libevent/evthread_win32.c index 2ec80560a5..913eccbd95 100644 --- a/contrib/libs/libevent/evthread_win32.c +++ b/contrib/libs/libevent/evthread_win32.c @@ -24,9 +24,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "event2/event-config.h" -#include "evconfig-private.h" +#include "evconfig-private.h" -#ifdef _WIN32 +#ifdef _WIN32 #ifndef _WIN32_WINNT /* Minimum required for InitializeCriticalSectionAndSpinCount */ #define _WIN32_WINNT 0x0403 @@ -43,7 +43,7 @@ struct event_base; #include "mm-internal.h" #include "evthread-internal.h" -#include "time-internal.h" +#include "time-internal.h" #define SPIN_COUNT 2000 @@ -61,17 +61,17 @@ evthread_win32_lock_create(unsigned locktype) } static void -evthread_win32_lock_free(void *lock_, unsigned locktype) +evthread_win32_lock_free(void *lock_, unsigned locktype) { - CRITICAL_SECTION *lock = lock_; + CRITICAL_SECTION *lock = lock_; DeleteCriticalSection(lock); mm_free(lock); } static int -evthread_win32_lock(unsigned mode, void *lock_) +evthread_win32_lock(unsigned mode, void *lock_) { - CRITICAL_SECTION *lock = lock_; + CRITICAL_SECTION *lock = lock_; if ((mode & EVTHREAD_TRY)) { return ! TryEnterCriticalSection(lock); } else { @@ -81,9 +81,9 @@ evthread_win32_lock(unsigned mode, void *lock_) } static int -evthread_win32_unlock(unsigned mode, void *lock_) +evthread_win32_unlock(unsigned mode, void *lock_) { - CRITICAL_SECTION *lock = lock_; + CRITICAL_SECTION *lock = lock_; LeaveCriticalSection(lock); return 0; } @@ -135,17 +135,17 @@ evthread_win32_condvar_alloc(unsigned condflags) } static void -evthread_win32_condvar_free(void *cond_) +evthread_win32_condvar_free(void *cond_) { - CONDITION_VARIABLE *cond = cond_; + CONDITION_VARIABLE *cond = cond_; /* There doesn't _seem_ to be a cleaup fn here... */ mm_free(cond); } static int -evthread_win32_condvar_signal(void *cond, int broadcast) +evthread_win32_condvar_signal(void *cond, int broadcast) { - CONDITION_VARIABLE *cond = cond_; + CONDITION_VARIABLE *cond = cond_; if (broadcast) WakeAllConditionVariable_fn(cond); else @@ -154,15 +154,15 @@ evthread_win32_condvar_signal(void *cond, int broadcast) } static int -evthread_win32_condvar_wait(void *cond_, void *lock_, const struct timeval *tv) +evthread_win32_condvar_wait(void *cond_, void *lock_, const struct timeval *tv) { - CONDITION_VARIABLE *cond = cond_; - CRITICAL_SECTION *lock = lock_; + CONDITION_VARIABLE *cond = cond_; + CRITICAL_SECTION *lock = lock_; DWORD ms, err; BOOL result; if (tv) - ms = evutil_tv_to_msec_(tv); + ms = evutil_tv_to_msec_(tv); else ms = INFINITE; result = SleepConditionVariableCS_fn(cond, lock, ms); @@ -206,18 +206,18 @@ evthread_win32_cond_alloc(unsigned flags) } static void -evthread_win32_cond_free(void *cond_) +evthread_win32_cond_free(void *cond_) { - struct evthread_win32_cond *cond = cond_; + struct evthread_win32_cond *cond = cond_; DeleteCriticalSection(&cond->lock); CloseHandle(cond->event); mm_free(cond); } static int -evthread_win32_cond_signal(void *cond_, int broadcast) +evthread_win32_cond_signal(void *cond_, int broadcast) { - struct evthread_win32_cond *cond = cond_; + struct evthread_win32_cond *cond = cond_; EnterCriticalSection(&cond->lock); if (broadcast) cond->n_to_wake = cond->n_waiting; @@ -230,16 +230,16 @@ evthread_win32_cond_signal(void *cond_, int broadcast) } static int -evthread_win32_cond_wait(void *cond_, void *lock_, const struct timeval *tv) +evthread_win32_cond_wait(void *cond_, void *lock_, const struct timeval *tv) { - struct evthread_win32_cond *cond = cond_; - CRITICAL_SECTION *lock = lock_; + struct evthread_win32_cond *cond = cond_; + CRITICAL_SECTION *lock = lock_; int generation_at_start; int waiting = 1; int result = -1; DWORD ms = INFINITE, ms_orig = INFINITE, startTime, endTime; if (tv) - ms_orig = ms = evutil_tv_to_msec_(tv); + ms_orig = ms = evutil_tv_to_msec_(tv); EnterCriticalSection(&cond->lock); ++cond->n_waiting; |