[swift-users] Illegal Instruction: 4 OS X libdispatch

Quinn "The Eskimo!" eskimo1 at apple.com
Tue May 3 12:11:13 CDT 2016


On 3 May 2016, at 18:02, Tyler Fleming Cloutier <cloutiertyler at aol.com> wrote:

> My motivation for doing something like that is that I would prefer not to make the listen function mutating inside my struct.

I recommend that you be explicit about your source references.  If this struct owns the source, have it maintain a strong reference to the source.  In your case it seems that `fd` is an attribute of the struct, so you could create the source when the struct is initialised with `fd`.  You don’t have to configure or resume it at that point, just create it.

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware




More information about the swift-users mailing list