-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add pthread_[s,g]etschedparam to emscripten. #2764
Add pthread_[s,g]etschedparam to emscripten. #2764
Conversation
r? @Amanieu (rust-highfive has picked a reviewer for you, use r? to override) |
@bors r+ |
📌 Commit c79cb77 has been approved by |
…, r=Amanieu Add pthread_[s,g]etschedparam to emscripten. Closes #2754 The functions are available in emscripten when built with the posix threads support.
💔 Test failed - checks-actions |
This
makes sense in case the emscripten toolchain used in CI isn't told to use enable POSIX threads, and it is disabled by default The corresponding flag isn't given to
I am curious, however, how does the Here is the code that works with emscripten on my machine: #include <stdio.h>
#include <unistd.h>
#include <pthread.h>
void *thread_callback()
{
sleep(1);
printf("Inside the thread.\n");
return NULL;
}
int main()
{
pthread_t thread_id;
pthread_create(&thread_id, NULL, thread_callback, NULL);
int policy = 0;
struct sched_param param;
pthread_getschedparam(thread_id, &policy, ¶m);
printf("Thread policy=%d, param.prio=%d\n", policy, param.sched_priority);
param.sched_priority = 50;
pthread_setschedparam(thread_id, SCHED_FIFO, ¶m);
pthread_getschedparam(thread_id, &policy, ¶m);
printf("New thread policy=%d, param.prio=%d\n", policy, param.sched_priority);
pthread_join(thread_id, NULL);
return 0;
} Compiling with
|
To add a compiler flag to the C API checker, you need to add However it could also be the case that the emcc version we are using in tests is too old. You can see this in ci/emscripten.sh which installs version 1.39.20. |
Thanks a lot for your help! I'll try adding the pthread flag there. |
@bors r+ |
📌 Commit e4f4684 has been approved by |
…, r=Amanieu Add pthread_[s,g]etschedparam to emscripten. Closes #2754 The functions are available in emscripten when built with the posix threads support.
💔 Test failed - checks-actions |
Added the
|
78c2146
to
94b7c5e
Compare
@bors r+ |
📌 Commit 94b7c5e has been approved by |
d4197b0
to
1515dd0
Compare
I am sorry, all successful checks, or am I seeing it wrong? |
Yeah, we don't run all the jobs on PR but do on bors as the number is huge and take a lot of time. Now you can use |
✌️ @vityafx can now approve this pull request |
@JohnTitor Thanks! @bors try |
…, r=<try> Add pthread_[s,g]etschedparam to emscripten. Closes #2754 The functions are available in emscripten when built with the posix threads support.
💔 Test failed - checks-actions |
1515dd0
to
78a91f3
Compare
@bors try |
…, r=<try> Add pthread_[s,g]etschedparam to emscripten. Closes #2754 The functions are available in emscripten when built with the posix threads support.
💔 Test failed - checks-actions |
This should enable pthread functionality for emcc.
78a91f3
to
43fba40
Compare
@bors try |
…, r=<try> Add pthread_[s,g]etschedparam to emscripten. Closes #2754 The functions are available in emscripten when built with the posix threads support.
💔 Test failed - checks-actions |
https://downforeveryoneorjustme.com/downloads.openwrt.org?proto=https Not it fails cuz https://downloads.openwrt.org/ is down... :( |
@bors try |
…, r=<try> Add pthread_[s,g]etschedparam to emscripten. Closes #2754 The functions are available in emscripten when built with the posix threads support.
💔 Test failed - checks-actions |
☔ The latest upstream changes (presumably #2915) made this pull request unmergeable. Please resolve the merge conflicts. |
Friendly-ping @vityafx, are still working on this? |
No, not anymore. I'd like someone having more knowledge of how the libc crate is organised to finish the job. I have already done what I could and it has taken too much time digging all of this alone. |
I'm going to close this then. Thanks for clarifying and submitting a PR anyway! |
Closes #2754
The functions are available in emscripten when built with the posix threads support.