Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runloop is not thread-safe #16

Closed
langyanduan opened this issue Sep 30, 2016 · 1 comment
Closed

Runloop is not thread-safe #16

langyanduan opened this issue Sep 30, 2016 · 1 comment
Assignees
Milestone

Comments

@langyanduan
Copy link

langyanduan commented Sep 30, 2016

It seem the lib add Timer to Runloop.main in network thread (generally not main thread).
But the document warning NSRunLoop is not thread safe.

The NSRunLoop class is generally not considered to be thread-safe and its methods should only be called within the context of the current thread. You should never try to call the methods of an NSRunLoop object running in a different thread, as doing so might cause unexpected results.

Core Foundation are generally thread-safe, use CFRunLoop* may be better.

@cnoon
Copy link
Member

cnoon commented Oct 1, 2016

Good catch @langyanduan. I've just pushed up 0f6bc51 which addresses the issue. This change will go out in a release here shortly.

Thanks again! 🍻

@cnoon cnoon closed this as completed Oct 1, 2016
@cnoon cnoon added the bug label Oct 1, 2016
@cnoon cnoon self-assigned this Oct 1, 2016
@cnoon cnoon added this to the 2.0.1 milestone Oct 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants