[Live-devel] Event loop and threads

Juan Manuel Lopez Baio jmbaio at gmail.com
Wed Aug 23 10:23:41 PDT 2006


> What may be happening is that your event loop has no pending events (i.e.,
> no incoming network packets to be handled, and no pending delayed tasks).
> If that happens, the event loop will (quite correctly) block indefinitely in
> "select()", and will never get around to checking the watch variable.
>
>
> For a way to overcome this, see
> <http://lists.live555.com/pipermail/live-devel/2006-March/004192.html>

Ok, so now I added a static dummy method to my class , that gets the
UsageEnvironment* as argument, since it's not a global variable but an
attribute of that same class (same as the watchVariable).
Then, from another method where I call doEventLoop (the threaded
method of the class), I added the call to the dummy task:

dummyTask(this->Env);
this->Env->taskScheduler().doEventLoop(&(this->stopServer));

Well, with that call there, I get a SEG FAULT. Looking at the the last
stack frames:

inside AlarmHandler::handleTimeout, fClientData == 0x0
inside dummyTask, env == 0x0
inside UsageEnvironment::taskScheduler, this == 0x0

;before that everything seems normal. If I remove the call to
dummyTask, everything works fine.

Do you know what could it be?

Thanks!


More information about the live-devel mailing list