You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can think of only 2 ways to circumvent this problem:
Using dispatch_get_current_queue and doing a lookup to find the context dependent data.
Using some form of dynamic function creation to create a new function depending on the context.
Both seem to have serious problems. The first is deprecated, and the second is hardly a portable solution.
Did I miss anything or is there a pressing reason that dispatch_source_set_*_handler_f do not have a context parameter? I suspect that changing the function signatures is a breaking change that may not be possible, but is there any improvement that can be made to libdispatch to alleviate this problem?
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: 32351524be15feca9ce95385a306d6cb
Issue Description:
I am evaluating libdispatch for a cross platform C project. I found a bug ( SR-7316 ) that is also related to dispatch sources. Dispatch sources seem hard to use without blocks, because I can not find a way to pass context to the handlers. This also goes against the api design advice in the documentation. (See https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man3/dispatch_api.3.html )
I can think of only 2 ways to circumvent this problem:
Using dispatch_get_current_queue and doing a lookup to find the context dependent data.
Using some form of dynamic function creation to create a new function depending on the context.
Both seem to have serious problems. The first is deprecated, and the second is hardly a portable solution.
Did I miss anything or is there a pressing reason that dispatch_source_set_*_handler_f do not have a context parameter? I suspect that changing the function signatures is a breaking change that may not be possible, but is there any improvement that can be made to libdispatch to alleviate this problem?
The text was updated successfully, but these errors were encountered: