是否有GCD队列的队列字典 [英] Is there a queue dictionary for a GCD queue
本文介绍了是否有GCD队列的队列字典的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我非常喜欢 NSThread
中的 threadDictionary
属性:非常方便存储每个线程所有权的东西。
是否有GCD队列的等效字典?
解决方案
您可能希望查看 dispatch_set_context / dispatch_get_context
。文档此处和此处。你必须管理上下文,但它可能正是你要找的。 p>
I am quite fond of the threadDictionary
property in NSThread
: very handy to store things with per-thread ownership.
Is there an equivalent dictionary for a GCD queue?
解决方案
You might want to look into dispatch_set_context/dispatch_get_context
. Documentation here and here. You have to manage the context but it might be what you're looking for.
这篇关于是否有GCD队列的队列字典的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文