Use uv_async_init() and uv_async_send(). You can attach your own data pointer to the uv_async_t
's data
member (e.g. uv_async_t foo; foo.data = someptr;
). This is where you could store any data you need (e.g. information about the enumerated windows in your case) when signalling the main thread with uv_async_send()
.
Once inside the uv_async callback on the main thread, you can read from the same data
member and call to to javascript with the v8 API.