-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[wasm64] Fix and run all pthread browser tests #20527
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ void *WaitingThread(void *arg) | |
|
||
int main() | ||
{ | ||
for(int i = 0; i < NUM_THREADS; ++i) | ||
for(intptr_t i = 0; i < NUM_THREADS; ++i) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Surely the number of threads fits in an lgtm regardless, but I'm curious if this fixed a specific issue? Maybe that the higher bits were undefined? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The specific issue here and elsewhere is that Casting an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, thanks. |
||
{ | ||
pthread_create(waitingThreads+i, 0, WaitingThread, (void*)i); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,7 +110,7 @@ int main() | |
for(int i = 0; i < NUM_THREADS; ++i) | ||
{ | ||
threadArg[i] = DUP(1 << i); | ||
pthread_create(&thread[i], NULL, thread_fetch_and_or, (void*)&threadArg[i]); | ||
pthread_create(&thread[i], NULL, thread_fetch_and_or, &threadArg[i]); | ||
} | ||
for(int i = 0; i < NUM_THREADS; ++i) pthread_join(thread[i], NULL); | ||
assert(fetch_and_or_data == HILO(65536 + (1<<(NUM_THREADS+1))-1, (1<<(NUM_THREADS+1))-1)); | ||
|
@@ -129,7 +129,7 @@ int main() | |
fetch_and_and_data = HILO(65536 + (1<<(NUM_THREADS+1))-1, (1<<(NUM_THREADS+1))-1); | ||
for(int i = 0; i < NUM_THREADS; ++i) | ||
{ | ||
threadArg[i] = DUP(~(1UL<<i)); | ||
threadArg[i] = DUP(~(1u<<i)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't this change us from an unsigned long to plain unsigned? We seem to store this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. DUP() here is supposed to take an i32 and use HILO() to construct an i64 where the low and high parts are the same. The current code which uses I verified this was broken on 64-bit linux too... and this was the fix there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, thanks. |
||
pthread_create(&thread[i], NULL, thread_fetch_and_and, (void*)&threadArg[i]); | ||
} | ||
for(int i = 0; i < NUM_THREADS; ++i) pthread_join(thread[i], NULL); | ||
|
@@ -149,7 +149,7 @@ int main() | |
fetch_and_xor_data = HILO(32768 + (1<<NUM_THREADS), 1<<NUM_THREADS); | ||
for(int i = 0; i < NUM_THREADS; ++i) | ||
{ | ||
threadArg[i] = DUP(~(1UL<<i)); | ||
threadArg[i] = DUP(~(1u<<i)); | ||
pthread_create(&thread[i], NULL, thread_fetch_and_xor, (void*)&threadArg[i]); | ||
} | ||
for(int i = 0; i < NUM_THREADS; ++i) pthread_join(thread[i], NULL); | ||
|
Uh oh!
There was an error while loading. Please reload this page.