update NSPR to 4.24 and keep NSPR Bug 1586070 and win64 patch intact.

This commit is contained in:
Roy Tam 2020-01-03 13:34:04 +08:00
commit 0b9855b841
487 changed files with 42933 additions and 48679 deletions

View file

@ -3,15 +3,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifdef XP_BEOS
#include <stdio.h>
int main()
{
printf( "This test is not ported to the BeOS\n" );
return 0;
}
#else
#include "nspr.h"
#include "prpriv.h"
#include "prinrval.h"
@ -42,21 +33,21 @@ Level_1_Thread(void *arg)
PRThread *thr;
thr = PR_CreateThreadGCAble(PR_USER_THREAD,
Level_2_Thread,
NULL,
PR_PRIORITY_HIGH,
scope,
PR_JOINABLE_THREAD,
0);
Level_2_Thread,
NULL,
PR_PRIORITY_HIGH,
scope,
PR_JOINABLE_THREAD,
0);
if (!thr) {
printf("Could not create thread!\n");
} else {
printf("Level_1_Thread[0x%lx] created %15s thread 0x%lx\n",
PR_GetCurrentThread(),
(scope == PR_GLOBAL_THREAD) ?
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
thr);
PR_GetCurrentThread(),
(scope == PR_GLOBAL_THREAD) ?
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
thr);
PR_JoinThread(thr);
}
PR_EnterMonitor(mon);
@ -72,13 +63,13 @@ static PRStatus PR_CALLBACK print_thread(PRThread *thread, int i, void *arg)
PRWord *registers;
printf(
"\nprint_thread[0x%lx]: %-20s - i = %ld\n",thread,
"\nprint_thread[0x%lx]: %-20s - i = %ld\n",thread,
(PR_GLOBAL_THREAD == PR_GetThreadScope(thread)) ?
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD", i);
registers = PR_GetGCRegisters(thread, 0, (int *)&words);
if (registers)
printf("Registers R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
registers[0],registers[1],registers[2],registers[3]);
registers[0],registers[1],registers[2],registers[3]);
printf("Stack Pointer = 0x%lx\n", PR_GetSP(thread));
return PR_SUCCESS;
}
@ -97,21 +88,21 @@ static void Level_0_Thread(PRThreadScope scope1, PRThreadScope scope2)
alive = count;
for (n=0; n<count; n++) {
thr = PR_CreateThreadGCAble(PR_USER_THREAD,
Level_1_Thread,
(void *)scope2,
PR_PRIORITY_NORMAL,
scope1,
PR_UNJOINABLE_THREAD,
0);
Level_1_Thread,
(void *)scope2,
PR_PRIORITY_NORMAL,
scope1,
PR_UNJOINABLE_THREAD,
0);
if (!thr) {
printf("Could not create thread!\n");
alive--;
}
printf("Level_0_Thread[0x%lx] created %15s thread 0x%lx\n",
PR_GetCurrentThread(),
(scope1 == PR_GLOBAL_THREAD) ?
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
thr);
PR_GetCurrentThread(),
(scope1 == PR_GLOBAL_THREAD) ?
"PR_GLOBAL_THREAD" : "PR_LOCAL_THREAD",
thr);
PR_Sleep(0);
}
@ -120,7 +111,7 @@ static void Level_0_Thread(PRThreadScope scope1, PRThreadScope scope2)
registers = PR_GetGCRegisters(me, 1, (int *)&words);
if (registers)
printf("My Registers: R0 = 0x%x R1 = 0x%x R2 = 0x%x R3 = 0x%x\n",
registers[0],registers[1],registers[2],registers[3]);
registers[0],registers[1],registers[2],registers[3]);
printf("My Stack Pointer = 0x%lx\n", PR_GetSP(me));
PR_ResumeAll();
@ -184,4 +175,3 @@ int main(int argc, char **argv)
return 0;
}
#endif /* XP_BEOS */