-
-
Notifications
You must be signed in to change notification settings - Fork 874
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
Made all accesses to PFSQLiteDatabaseResult & Statement thread-safe. #511
Made all accesses to PFSQLiteDatabaseResult & Statement thread-safe. #511
Conversation
#import "PFThreadsafety.h" | ||
|
||
// PFThreadsafetySafeDispatchSync, but with a return type. | ||
#define thread_safe_sync(queue, block) ({ \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance we can make this a function?
This is not going to be nice (probably), but might feel better than having 2 defines that do the same thing...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how we can, seeing as the point of this macro is to be able to easily return any type, not just id
or int
.
We could stick it in PFThreadsafety.h
, perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, let's do it! :)
Few nits, otherwise lgtm. |
484a572
to
66f9bca
Compare
PR updated. |
Awesome! Please ship! |
I think this is what was causing the crashes seen in #290, but I'm not 100% sure. At the very least, accessing them this way was in violation of the SQLite spec.
66f9bca
to
9757503
Compare
….sqlite.threadsafe Made all accesses to PFSQLiteDatabaseResult & Statement thread-safe.
Awesome! It's HUUUUUUUUGE! |
@coolnalu No problem <3 |
I think this is what was causing the crashes seen in #290, but I'm not 100% sure.
At the very least, accessing them this way was in violation of the SQLite spec.