Thanks Marc.
On Wed, Jul 10, 2013 at 4:36 PM, Marc Lehmann <schm...@schmorp.de> wrote: > On Wed, Jul 10, 2013 at 03:57:40PM +0530, Aravindh Ramaswamy < > aravindhr...@gmail.com> wrote: > > I have started an empty event loop using ev_ref(loop) and ev_run(loop). > > Now, I want to add watcher for EV_READ event to this loop on the fly as > and > > when > > an event comes for EV_ASYNC. > > > > Is it possible to do so ? > > You can add watchers at any time when libev itself isn't executing. For > example, from inside an ev_async callback (but why would you need ev_ref > when > you already have an ev_async watcher registered?). > > Right. A mistake from my end. I didnt have EV_ASYNC in mind initially. My doubt was should i use ev_suspend and ev_resume to do so. > When using threads, you can provide your own mutex functions to lock > libev's > internal data, which makes it possible to add watchers even when the event > loop itself is blocked. See the "thread locking example" in the docs for > details. > > -- > The choice of a Deliantra, the free code+content > MORPG > -----==- _GNU_ http://www.deliantra.net > ----==-- _ generation > ---==---(_)__ __ ____ __ Marc Lehmann > --==---/ / _ \/ // /\ \/ / schm...@schmorp.de > -=====/_/_//_/\_,_/ /_/\_\ > -- Thanks and Regards, Aravindh.R
_______________________________________________ libev mailing list libev@lists.schmorp.de http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev