If the library made no provision for the caller to give a unique token which would help to identify it in the callback then that library does not expect to have more than one caller-and-callback in play at any one time, or, even worse, expects you to arrange some thread-local storage in the caller to resolve the correct one. Without knowing more about the library there isn't much to say, except that you should be able to serialize all calls into it on the Go side, leaving only one possible *A with an outstanding function call at a time. This is going to be slow.
-- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.