Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - hidd_reports_detach() usage: (1 Item)
   
hidd_reports_detach() usage  
Sorry, I do not have manuals in hand, but how a conflict is to be resolved when hidd_reports_detach() is called and 
hidd_funcs_t::removal callback is invoked at the same time? The callback is supposed to call the same 
hidd_reports_detach(). So, to avoid a race condition I must lock the call with a mutex. On the other hand, I suppose the
 HID library should also lock its structures to prevent report detach while callbacks are called. Would not there be a 
deadlock while my thread that calls hidd_reports_detach() and is waiting for a mutex inside of HID library for callback 
to return and the callback is waiting for a mutex in my code to access hidd_reports_detach()?