Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
P
Publishers
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Public
Publishers
Commits
86d8f192
Verified
Commit
86d8f192
authored
Sep 16, 2019
by
Daniel Tull
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace use of pthread mutex with NSLock
parent
91f56193
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
Sources/Publishers/CombineLatestCollection.swift
Sources/Publishers/CombineLatestCollection.swift
+5
-5
No files found.
Sources/Publishers/CombineLatestCollection.swift
View file @
86d8f192
...
...
@@ -62,15 +62,15 @@ extension CombineLatestCollection {
var
values
:
[
Publishers
.
Element
.
Output
?]
=
Array
(
repeating
:
nil
,
count
:
publishers
.
count
)
var
completions
=
0
var
hasCompleted
=
false
var
lock
=
pthread_mutex_t
()
let
lock
=
NSLock
()
subscribers
=
publishers
.
enumerated
()
.
map
{
index
,
publisher
in
publisher
.
sink
(
receiveCompletion
:
{
completion
in
pthread_mutex_lock
(
&
lock
)
defer
{
pthread_mutex_unlock
(
&
lock
)
}
lock
.
lock
(
)
defer
{
lock
.
unlock
(
)
}
guard
case
.
finished
=
completion
else
{
// One failure in any of the publishers cause a
...
...
@@ -89,8 +89,8 @@ extension CombineLatestCollection {
},
receiveValue
:
{
value
in
pthread_mutex_lock
(
&
lock
)
defer
{
pthread_mutex_unlock
(
&
lock
)
}
lock
.
lock
(
)
defer
{
lock
.
unlock
(
)
}
guard
!
hasCompleted
else
{
return
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment