Suppose my libusb does a callback to the C callback function I provided, which, in turn, will want to run a Pike callback function the user supplied.
What if the usblibrary decides to call my callback during a time where threads are allowed? Is there any way for me to detect this? What to do about this? Conditionally run something like:
static void usbcallback(...) { if(threadsareallowed) THREADS_DISALLOW(); -- Run the Pike callback function. -- if(threadsareallowed) THREADS_ALLOW(); }
Is this even going to work?