We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5068 - setFrame on auxiliary thread causes crash
Summary: setFrame on auxiliary thread causes crash
Status: ASSIGNED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.1
Hardware: x86_64 macOS 10.15
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-30 18:43 UTC by Emir Marincic
Modified: 2020-03-31 07:02 UTC (History)
0 users

See Also:


Attachments
setFrame async (1016 bytes, text/plain)
2020-03-30 18:43 UTC, Emir Marincic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Emir Marincic 2020-03-30 18:43:51 UTC
Created attachment 4283 [details]
setFrame async

setFrame is only allowed on the main thread, again I'm not sure if you want to support rendering on a thread but this patch fixes the issue. I used GCD to fix it but if you'd rather we use performSelectorOnMainThread again we could use an NSInvocation.
Comment 1 Sam Lantinga 2020-03-30 22:32:22 UTC
I'm not opposed to this specific patch, but SDL window functions are only valid on the main thread, and making some of them work on some platforms on different threads will lead to confusion and broken applications if that behavior is relied upon.

I'm tempted not to include this patch for that reason. Ryan, what are your thoughts?
Comment 2 Emir Marincic 2020-03-31 07:02:00 UTC
FWIW I also thought this was not the greatest idea, the only reason I made a patch is to see how others feel about it, and the fact that neither linux/x11 nor windows imposed the main thread limitation so I wanted to level the behaviour.