mirror of
https://github.com/stefanocasazza/ULib.git
synced 2025-09-28 19:05:55 +08:00
fix
This commit is contained in:
parent
619127f83e
commit
0bd1d988f4
|
@ -205,6 +205,7 @@ protected:
|
||||||
static int nfd_ready; // the number of file descriptors ready for the requested I/O
|
static int nfd_ready; // the number of file descriptors ready for the requested I/O
|
||||||
static UEventFd** lo_map_fd;
|
static UEventFd** lo_map_fd;
|
||||||
static UEventFd* handler_event;
|
static UEventFd* handler_event;
|
||||||
|
static uint32_t bepollet_threshold;
|
||||||
static UGenericHashMap<int,UEventFd*>* hi_map_fd; // maps a fd to a node pointer
|
static UGenericHashMap<int,UEventFd*>* hi_map_fd; // maps a fd to a node pointer
|
||||||
|
|
||||||
#ifndef USE_LIBEVENT
|
#ifndef USE_LIBEVENT
|
||||||
|
@ -234,7 +235,7 @@ protected:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
static uint32_t nwatches, max_nfd_ready, bepollet_threshold;
|
static uint32_t nwatches, max_nfd_ready;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_POLL_H
|
#ifndef HAVE_POLL_H
|
||||||
|
|
|
@ -58,6 +58,7 @@ int UNotifier::nfd_ready; // the number of file desc
|
||||||
uint32_t UNotifier::min_connection;
|
uint32_t UNotifier::min_connection;
|
||||||
uint32_t UNotifier::num_connection;
|
uint32_t UNotifier::num_connection;
|
||||||
uint32_t UNotifier::max_connection;
|
uint32_t UNotifier::max_connection;
|
||||||
|
uint32_t UNotifier::bepollet_threshold = 10;
|
||||||
UEventFd* UNotifier::handler_event;
|
UEventFd* UNotifier::handler_event;
|
||||||
UEventFd** UNotifier::lo_map_fd;
|
UEventFd** UNotifier::lo_map_fd;
|
||||||
UGenericHashMap<int,UEventFd*>* UNotifier::hi_map_fd; // maps a fd to a node pointer
|
UGenericHashMap<int,UEventFd*>* UNotifier::hi_map_fd; // maps a fd to a node pointer
|
||||||
|
@ -65,7 +66,6 @@ UGenericHashMap<int,UEventFd*>* UNotifier::hi_map_fd; // maps a fd to a node poi
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
uint32_t UNotifier::nwatches;
|
uint32_t UNotifier::nwatches;
|
||||||
uint32_t UNotifier::max_nfd_ready;
|
uint32_t UNotifier::max_nfd_ready;
|
||||||
uint32_t UNotifier::bepollet_threshold = 10;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ENABLE_THREAD) && defined(U_SERVER_THREAD_APPROACH_SUPPORT)
|
#if defined(ENABLE_THREAD) && defined(U_SERVER_THREAD_APPROACH_SUPPORT)
|
||||||
|
@ -508,7 +508,7 @@ loop0:
|
||||||
# else
|
# else
|
||||||
int i = 0;
|
int i = 0;
|
||||||
pevents = events;
|
pevents = events;
|
||||||
# if defined(U_EPOLLET_POSTPONE_STRATEGY)
|
# ifdef U_EPOLLET_POSTPONE_STRATEGY
|
||||||
bool bloop1 = false;
|
bool bloop1 = false;
|
||||||
bepollet = ((uint32_t)nfd_ready >= bepollet_threshold);
|
bepollet = ((uint32_t)nfd_ready >= bepollet_threshold);
|
||||||
|
|
||||||
|
@ -580,7 +580,7 @@ loop0:
|
||||||
goto loop0;
|
goto loop0;
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined(U_EPOLLET_POSTPONE_STRATEGY)
|
# ifdef U_EPOLLET_POSTPONE_STRATEGY
|
||||||
if (bepollet)
|
if (bepollet)
|
||||||
{
|
{
|
||||||
if (bloop1 == false)
|
if (bloop1 == false)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user