Grand Central Dispatch (GCD) dispatch source flags

前端 未结 2 1251
半阙折子戏
半阙折子戏 2021-02-05 21:41

I recently switched from using kqueue to GCD dispatch sources to monitor file changes. This has worked out well and resulted in a much simpler API. I documented my switch here.

2条回答
  •  粉色の甜心
    2021-02-05 22:18

    You may change *dispatch_source_get_mask(source)* to *dispatch_source_get_data(source)*, as dispatch_source_get_mask(source) returns all the flags you passed in the creation of the handler instead of the event generated.

提交回复
热议问题