> On Jun 13, 2017, at 17:56, Super Twang <[email protected]> wrote: > > Saúl, my apologies, I accidentally published before finishing the post. I > tried to delete the incomplete one, but it seems to have gotten out at least > to you. There should be a post right next to this with a similar title that > is the "real" one. > > Its current advice, to make sure the uv_asnyc_t handle is the same in both > main loop and calling thread, unfortunately doesn't help... still no > callback. Do I need to be concerned about initialization order of things? > > As to your other question, yes, the main loop is running uv_run. >
I can’t see any code in this post. At any rate, the proper sequence of things should be as follows: - (main thread): initialize async handle - (main thread): run loop - (another thread): uv_async_send You can checkout our tests, this pattern is used quite a bit. Cheers, > Dave > > > On Tuesday, June 13, 2017 at 5:02:24 PM UTC-5, Saúl Ibarra Corretgé wrote: > > > On Jun 13, 2017, at 08:31, Super Twang <[email protected]> wrote: > > > > > > I've got a thread in which I'm waiting for MIDI messages, gathering them > > into a thread-safe queue and then trying to trigger an async callback on > > the main loop, but my callback never seems to fire. > > > > > > Here's my callback: > > > > void dataReadyCb( uv_async_t *hdl ) > > { > > assert(0); > > assert(hdl); > > assert(hdl->data); > > > > pxEvThMidiIn *handler = static_cast<pxEvThMidiIn*>(hdl->data); > > handler->processIncomingMidi(); > > } > > > > > > Initializer in the main loop: > > > > uv_async_t myHdl; > > > > uv_async_init( uv_default_loop(), &myHdl, dataReadyCb ); > > > > > > Then the thread starts... > > > > and I call: > > > > sendData() > > { > > > > I assume there is an uv_async_send missing here :-) > > Silly question, but is the main loop thread running uv_run ? > > -- > Saúl > > > -- > You received this message because you are subscribed to the Google Groups > "libuv" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/libuv. > For more options, visit https://groups.google.com/d/optout. -- Saúl -- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/libuv. For more options, visit https://groups.google.com/d/optout.
