[Prev][Next][Index][Thread]
Re: functionality of HTEventRequestTerminate
-
To: "Daniel W. Connolly" <connolly@beach.w3.org>
-
Subject: Re: functionality of HTEventRequestTerminate
-
From: Erik Selberg <selberg@cs.washington.edu>
-
Date: Fri, 26 Jan 1996 02:19:26 PST
-
Cc: www-lib@w3.org
-
From speed@cs.washington.edu Fri Jan 26 05: 19:30 1996
-
Gcc: nnfolder:misc-mail
-
In-Reply-To: "Daniel W. Connolly"'s message of Fri, 26 Jan 1996 04:51:43 -0500
-
Message-Id: <199601261019.CAA07162@wally.cs.washington.edu>
-
References: <ka2f46d7@totally-fudged-out-message-id>
-
Sender: speed@cs.washington.edu
"Daniel W Connolly" writes:
> I suggest the design used in the ILU runtime:
(which is a mainEventLoop() function and a stopMainEventLoop()
function, which causes the mainEventLoop() to stop after the current
interation)
Well, as I see it, the HTEvent_Loop can be stopped by either using:
(1) a library function which sets an internal library variable
(2) a user function which presumably checks some user variable, and
returns true / false
I'm partial to (2), mostly because I find it cleaner in terms of where
it comes in the loop (it's intuitive where it's called) and it allows
for greater flexibility.
Then again, there's no reason why both can't exist:
PRIVATE quit_main_loop = 0;
typedef int HTEventLoopTermFunc();
PRIVATE HTEventLoopTermFunc *eventloop_termfunc;
PUBLIC HTEventLoop_Quit() {
quit_main_loop = 1;
}
PUBLIC HTEvent_Loop() {
quit_main_loop = 0;
do {
...
} while (!quit_main_loop &&
(!eventloop_termfunc || (*eventloop_termfunc)()));
}
-Erik
Follow-Ups: