Skip to content

[d16-5] [CoreFoundation] CFBundle.GetAll better thread safe. - #7430

Merged
mandel-macaque merged 2 commits into
dotnet:d16-5from
monojenkins:backport-pr-7425-to-d16-5
Nov 14, 2019
Merged

[d16-5] [CoreFoundation] CFBundle.GetAll better thread safe.#7430
mandel-macaque merged 2 commits into
dotnet:d16-5from
monojenkins:backport-pr-7425-to-d16-5

Conversation

@monojenkins

Copy link
Copy Markdown
Contributor

The initial solution fixed the rance condition in which the index
changed, but that did not guarantee that we would get the correct
bundles. We now clone the CFArray (which also clones the callbacks set
to the array) and iterate over it to make sure Apple does not do evil
things while we are iteraing.

Better Fixes: https://github.com/xamarin/maccore/issues/940

Backport of #7425.

/cc @mandel-macaque

The initial solution fixed the rance condition in which the index
changed, but that did not guarantee that we would get the correct
bundles. We now clone the CFArray (which also clones the callbacks set
to the array) and iterate over it to make sure Apple does not do evil
tings while we are iteraing.

Better Fixes: https://github.com/xamarin/maccore/issues/940
@monojenkins

Copy link
Copy Markdown
Contributor Author

Build failure
Build failed or was aborted

🔥 Build failed 🔥

@mandel-macaque

Copy link
Copy Markdown
Contributor

build

@monojenkins

Copy link
Copy Markdown
Contributor Author

Build failure
Build failed or was aborted

🔥 Build failed 🔥

@mandel-macaque

Copy link
Copy Markdown
Contributor

Argh, is missing the CFArray commit :/. I'll fix it

When working on https://github.com/xamarin/maccore/issues/940 we noticed
that clone the array would be a better approach.

The CFArrayCreateCopy add some nice things:

* The pointer values from theArray are copied into the new array.
* The values are also retained by the new array.
* The count of the new array is the same as theArray
* The new array uses the same callbacks as theArray. [IMPORTANT]

Whith this in, we can have a better fix for https://github.com/xamarin/maccore/issues/940
@monojenkins

Copy link
Copy Markdown
Contributor Author

Build failure
Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (no change)
🔥 Test run failed 🔥

Test results

1 tests failed, 86 tests passed.

Failed tests

  • monotouch-test/watchOS 32-bits - simulator/Debug: Crashed

@mandel-macaque

Copy link
Copy Markdown
Contributor

@mandel-macaque
mandel-macaque merged commit 54b2164 into dotnet:d16-5 Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants