1
0
mirror of https://github.com/stefanocasazza/ULib.git synced 2025-09-28 19:05:55 +08:00
This commit is contained in:
stefanocasazza 2016-02-24 18:11:04 +01:00
parent 619127f83e
commit 0bd1d988f4
2 changed files with 5 additions and 4 deletions

View File

@ -205,6 +205,7 @@ protected:
static int nfd_ready; // the number of file descriptors ready for the requested I/O
static UEventFd** lo_map_fd;
static UEventFd* handler_event;
static uint32_t bepollet_threshold;
static UGenericHashMap<int,UEventFd*>* hi_map_fd; // maps a fd to a node pointer
#ifndef USE_LIBEVENT
@ -234,7 +235,7 @@ protected:
#endif
#ifdef DEBUG
static uint32_t nwatches, max_nfd_ready, bepollet_threshold;
static uint32_t nwatches, max_nfd_ready;
#endif
#ifndef HAVE_POLL_H

View File

@ -58,6 +58,7 @@ int UNotifier::nfd_ready; // the number of file desc
uint32_t UNotifier::min_connection;
uint32_t UNotifier::num_connection;
uint32_t UNotifier::max_connection;
uint32_t UNotifier::bepollet_threshold = 10;
UEventFd* UNotifier::handler_event;
UEventFd** UNotifier::lo_map_fd;
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
uint32_t UNotifier::nwatches;
uint32_t UNotifier::max_nfd_ready;
uint32_t UNotifier::bepollet_threshold = 10;
#endif
#if defined(ENABLE_THREAD) && defined(U_SERVER_THREAD_APPROACH_SUPPORT)
@ -508,7 +508,7 @@ loop0:
# else
int i = 0;
pevents = events;
# if defined(U_EPOLLET_POSTPONE_STRATEGY)
# ifdef U_EPOLLET_POSTPONE_STRATEGY
bool bloop1 = false;
bepollet = ((uint32_t)nfd_ready >= bepollet_threshold);
@ -580,7 +580,7 @@ loop0:
goto loop0;
}
# if defined(U_EPOLLET_POSTPONE_STRATEGY)
# ifdef U_EPOLLET_POSTPONE_STRATEGY
if (bepollet)
{
if (bloop1 == false)