Is it possible to use this function with eg. std::thread or boost::thread?
If there was a function like emscripten_request_canvas_transfer that would do a blocking call to main thread and transfer the canvas from there to the original calling thread, this would make canvas transfer work irrespective of how the thread was created. This would also simplify/obsolete the -s OFFSCREENCANVASES_TO_PTHREAD.