Closed name1e5s closed 1 year ago
Thanks! A little bit of history here: initially, the code was written in a way almost precisely, just as you did. But then I found that some people really prefer niceness control as well, and I had to unify the code so that it works almost exactly the same everywhere. I also noticed in my test suite that macOS allowed much more than other unix systems. But I didn't know how much people wanted this to work on macOS, so I didn't know whether it would be better to leave it as it was for macOS or do it the same way everywhere. Your pull request here means that I was wrong and made a wrong decision. Thank you for correcting this back!
I've just pushed the changes from this PR, slightly adjusted. Feel free to open another PR if you want something else :-)
on apple targets, only
pthread_setschedparam
is allowed to upgrade threads to a higher priority. this PR change the implementation ofset_thread_priority_and_policy_deadline
on macOS and iOS targets to usepthread_setschedparam
only.Ref: