Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix race condition issue in combineLatest#402

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
AdamPitt7 wants to merge1 commit intoReactiveX:master
base:master
Choose a base branch
Loading
fromAdamPitt7:fix-combine-latest-race-condition

Conversation

@AdamPitt7
Copy link

This is to fix a race condition in the combineLatest function.
I was getting nil pointer exceptions when using combineLatest callback functionf FuncN with multiple observables which are also using combineLatest.

From what I can tell, the race condition is caused when one observable has incremented the counter, but has not yet set the cache variables[i] = item.V
Meanwhile, another observable is checking if the counter is equal to the number of observablesatomic.LoadUint32(&counter) == size and then calling the callback function with the cache variable which now includes a nil value.

By moving the counter increment into the lock, this should fix the race condition issue.

breadchris reacted with thumbs up emoji
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@AdamPitt7

[8]ページ先頭

©2009-2025 Movatter.jp