Skip to content
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

[SR-6810] Timer does not fire in Linux, if added into .commonModes #4263

Open
swift-ci opened this issue Jan 23, 2018 · 3 comments
Open

[SR-6810] Timer does not fire in Linux, if added into .commonModes #4263

swift-ci opened this issue Jan 23, 2018 · 3 comments

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-6810
Radar None
Original Reporter ttflee (JIRA User)
Type Bug

Attachment: Download

Environment

Ubuntu 14.04, 16.04

Swift 4.0.3

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug, Linux
Assignee @millenomi
Priority Medium

md5: 8a1f53554802145e87b26cf3d865b8f8

Issue Description:

Timer added to .commonModes could not be fired in Ubuntu 14.04/Swift 4.0.3 RELEASE. On the contrary, Dispatch Source Timer does work smoothly.

The open sourced implementations of CFRunLoopAddSource(), CFRunLoopAddObserver(), CFRunLoopAddTimer() etc., compare modeName against kCFRunLoopCommonModes using identity (==) rather than equality (CFEqual()). This might be the root cause of the issue and others.

@swift-ci
Copy link
Contributor Author

Comment by Zhang Chen (JIRA)

`Timer.scheduledTimer(withTimeInterval:repeats:block)` works.

@swift-ci
Copy link
Contributor Author

Comment by Zhang Chen (JIRA)

The reason seems to be that commonModes is not supported in RunLoop for Linux.

@swift-ci
Copy link
Contributor Author

Comment by Zhang Chen (JIRA)

The CFRunLoop implementation compares run loop mode name against kCFRunLoopCommonModes using identity of C string, rather than CFEqual().

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant