Skip to content

Commit 0d526fd

Browse files
authored
Change upload coordinator to not block main thread (#5712)
* Change upload coordinator to not block main thread Fixes #5707 Fixes #5708 * Update CHANGELOG.md
1 parent cde656a commit 0d526fd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

GoogleDataTransport/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Unreleased
2+
- Stopped GDTCORUploadCoordinator from blocking main thread. (#5707, #5708)
3+
14
# v6.2.0
25
- Added an API for arbitrary data persistence on storage instances.
36
- Added an API for fetching storage instances specific to a target.

GoogleDataTransport/GDTCORLibrary/GDTCORUploadCoordinator.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ - (void)forceUploadForTarget:(GDTCORTarget)target {
6363
* check the next-upload clocks of all targets to determine if an upload attempt can be made.
6464
*/
6565
- (void)startTimer {
66-
dispatch_sync(_coordinationQueue, ^{
66+
dispatch_async(_coordinationQueue, ^{
6767
self->_timer =
6868
dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, self->_coordinationQueue);
6969
dispatch_source_set_timer(self->_timer, DISPATCH_TIME_NOW, self->_timerInterval,
@@ -196,7 +196,7 @@ - (void)appWillForeground:(GDTCORApplication *)app {
196196
}
197197

198198
- (void)appWillBackground:(GDTCORApplication *)app {
199-
dispatch_sync(_coordinationQueue, ^{
199+
dispatch_async(_coordinationQueue, ^{
200200
[self stopTimer];
201201
});
202202
}

0 commit comments

Comments
 (0)