Closed
Bug 1397194
Opened 8 years ago
Closed 7 years ago
Follow up Bug 1347519, polling manually in macOS gamepad API backend
Categories
(Core :: DOM: Core & HTML, enhancement, P2)
Tracking
()
RESOLVED
FIXED
mozilla59
| Tracking | Status | |
|---|---|---|
| firefox59 | --- | fixed |
People
(Reporter: cleu, Assigned: cleu)
References
Details
Attachments
(1 file)
In current design, we use CFRunLoopRun as a blocking eventloop for receiving gamepad events and call CFRunLoopStop in a different thread to shut it down.
Although Apple's dev docs claim that it's "generally" thread-safe, it leads to
number of crashes in libsystem_pthread which is reported in Bug 1347519.
To avoid this, we should manage eventloops ourselves.
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 3•8 years ago
|
||
Updated•8 years ago
|
Priority: -- → P2
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•8 years ago
|
Attachment #8904936 -
Flags: review?(kyle)
| Assignee | ||
Comment 5•8 years ago
|
||
Hi Kyle,
I once wanted to mitigate the crash inside pthread by using macos' native callback functions in bug 1347519, but it does not work properly, so I tried to rewrite the eventloop by gecko's nsITimer just like our Windows XInput backend.
Actually this patch is finished months ago, but I had concern landing it that time because this change is hard to test by mochitest and the crash rate is low, however, I encounter a 100% crash case in bug 1422560, I think it's time to give up using macos' native event loop.
BTW, I remembered that you were developing WebMIDI backend in mac and encounter issue about the blocking CFRunLoop for USB device detecting, I think maybe this solution apply to your situation as well.
Comment 6•8 years ago
|
||
Wow, thanks! The timing on this is great too, as I'm now reworking the patches for WebMIDI and was going to be hopefully shipping with a macOS implementation. :D
Comment 7•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8904936 [details]
Bug 1397194 - Polling manually in macOS gamepad API backend
https://reviewboard.mozilla.org/r/176748/#review211544
::: dom/gamepad/cocoa/CocoaGamepad.cpp:515
(Diff revision 3)
>
> return dict;
> }
>
> -DarwinGamepadService::DarwinGamepadService() : mManager(nullptr) {}
> +DarwinGamepadService::DarwinGamepadService()
> + : mManager(nullptr), mIsRunning(false) {}
Nit: {} on separate line.
Attachment #8904936 -
Flags: review?(kyle) → review+
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•7 years ago
|
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/43f6a70b2f39
Polling manually in macOS gamepad API backend r=qdot
Keywords: checkin-needed
Comment 10•7 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox59:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Updated•7 years ago
|
status-firefox57:
affected → ---
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•