Skip to content

BUG Running FSNetworking in background threads #16

@tomandersen

Description

@tomandersen

I don't know if its supported, but it seems to work. Mostly.

In FSNConnection, there is the mutableset of current connections.

mutableConnections

It is a NSMutableSet and is a global, but accessed by eac h object with no @synchronize() {} block.

So the code need to change in two places -

In cleanup

NSMutableSet *requests = [self.class mutableConnections];
@synchronized(requests) {
    [requests removeObject:self];
}

And in start
NSMutableSet *connections = [self.class mutableConnections];
@synchronized(connections) {
[connections addObject:self];
}

I got a crash (as would make sense) when using about 3 of these on threads on 10.8.4 Mac, with XCode 5. With Zombies and what not on, it pointed right at the cleanup line.

--Tom

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions