aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/hw')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Display.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Display.h29
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Handlers.c8
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c9
4 files changed, 22 insertions, 26 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c
index c683751f6..c764f50ae 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Display.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c
@@ -669,7 +669,7 @@ static void nxagentDisplayBlockHandler(Display *display, int reason)
nxagentBlocking = 1;
- if (SmartScheduleDisable == 1)
+ if (!SmartScheduleSignalEnable)
{
/*
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.h b/nx-X11/programs/Xserver/hw/nxagent/Display.h
index 75da371d8..759b0de35 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Display.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Display.h
@@ -116,36 +116,29 @@ Bool nxagentReconnectDisplay(void *p0);
* Deal with the smart scheduler.
*/
+#if HAVE_SETITIMER
#define nxagentInitTimer() \
\
SmartScheduleInit();
#define nxagentStopTimer() \
\
- if (SmartScheduleTimerStopped == 0) \
- { \
- SmartScheduleStopTimer(); \
- } \
-\
- SmartScheduleIdle = 1;
+ SmartScheduleStopTimer(); \
#define nxagentStartTimer() \
\
- if (SmartScheduleTimerStopped == 1) \
- { \
- SmartScheduleStartTimer(); \
- } \
-\
- SmartScheduleIdle = 0;
+ SmartScheduleStartTimer();
#define nxagentDisableTimer() \
\
- if (SmartScheduleTimerStopped == 0) \
- { \
- SmartScheduleStopTimer(); \
- } \
-\
- SmartScheduleDisable = 1;
+ SmartScheduleStopTimer(); \
+ SmartScheduleSignalEnable = FALSE;
+#else
+#define nxagentInitTimer()
+#define nxagentStopTimer()
+#define nxagentStartTimer()
+#define nxagentDisableTimer()
+#endif /* HAVE_SETITIMER */
/*
* File descriptor currently used by
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c
index 8e80a1524..634f7aafd 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c
@@ -597,7 +597,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
nxagentHandleConnectionStates();
}
- if (SmartScheduleDisable == 1)
+ if (!SmartScheduleSignalEnable)
{
#ifdef DEBUG
@@ -885,7 +885,7 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask)
nxagentHandleConnectionStates();
}
- if (SmartScheduleDisable == 1)
+ if (!SmartScheduleSignalEnable)
{
#ifdef DEBUG
@@ -1075,7 +1075,7 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out)
#endif
}
- if (SmartScheduleDisable == 1)
+ if (!SmartScheduleSignalEnable)
{
/*
@@ -1150,7 +1150,7 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out)
* the inner dispatch loop forever.
*/
- if (SmartScheduleDisable == 1)
+ if (!SmartScheduleSignalEnable)
{
if (client -> index != nxagentDispatch.client)
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
index 652d54479..5792a41c5 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
@@ -387,7 +387,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
#endif
- if (nready && !SmartScheduleDisable)
+ if (nready)
{
clientReady[0] = SmartScheduleClient (clientReady, nready);
nready = 1;
@@ -422,8 +422,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
ProcessInputEvents();
FlushIfCriticalOutputPending();
}
- if (!SmartScheduleDisable &&
- (SmartScheduleTime - start_tick) >= SmartScheduleSlice)
+ if ((SmartScheduleTime - start_tick) >= SmartScheduleSlice)
{
/* Penalize clients which consume ticks */
if (client->smart_priority > SMART_MIN_PRIORITY)
@@ -512,6 +511,10 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
result = (* client->requestVector[MAJOROP])(client);
#endif
+
+ if (!SmartScheduleSignalEnable)
+ SmartScheduleTime = GetTimeInMillis();
+
if (result != Success)
{
if (client->noClientException != Success)