race condition fix (win tun)
This commit is contained in:
1 parent
5dfd1ea5fe
commit
5d4cef0c3e
6 files changed
+32
-7
No files matched your search
@@ -1426,6 +1426,19 @@ void uasync_get_stats(struct UASYNC* ua, size_t* timer_alloc, size_t* timer_u_fr
|
||||
if (socket_u_free) *socket_u_free = ua->socket_free_count;
|
||||
}
|
||||
|
||||
void uasync_memsync(struct UASYNC* ua) {
|
||||
#ifdef _WIN32
|
||||
EnterCriticalSection(&ua->posted_lock);
|
||||
#else
|
||||
pthread_mutex_lock(&ua->posted_lock);
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
LeaveCriticalSection(&ua->posted_lock);
|
||||
#else
|
||||
pthread_mutex_unlock(&ua->posted_lock);
|
||||
#endif
|
||||
}
|
||||
|
||||
void uasync_post(struct UASYNC* ua, uasync_post_callback_t callback, void* arg) {
|
||||
if (!ua || !callback) return;
|
||||
|
||||
|
||||
Reference in new issue
Block a user