summaryrefslogtreecommitdiffstats
path: root/nsprpub/pr/tests/suspend.c
diff options
context:
space:
mode:
Diffstat (limited to 'nsprpub/pr/tests/suspend.c')
-rw-r--r--nsprpub/pr/tests/suspend.c56
1 files changed, 23 insertions, 33 deletions
diff --git a/nsprpub/pr/tests/suspend.c b/nsprpub/pr/tests/suspend.c
index 7dfe28c66..1976b9d8c 100644
--- a/nsprpub/pr/tests/suspend.c
+++ b/nsprpub/pr/tests/suspend.c
@@ -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 */