diff options
| author | Gareth Rees | 2013-03-07 14:53:31 +0000 |
|---|---|---|
| committer | Gareth Rees | 2013-03-07 14:53:31 +0000 |
| commit | b92064a89c4886a0c757a27ffbcb4a8536925148 (patch) | |
| tree | 849989b42618c6ebcd93b1f5f5c030336b14d0aa /mps/code | |
| parent | 49bb7de575c4a66164bb08d94dbcc6824a56ab14 (diff) | |
| download | emacs-b92064a89c4886a0c757a27ffbcb4a8536925148.tar.gz emacs-b92064a89c4886a0c757a27ffbcb4a8536925148.zip | |
The amcssth test case now registers its threads' stacks as roots with the mps.
Copied from Perforce
Change: 181076
ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
| -rw-r--r-- | mps/code/amcssth.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mps/code/amcssth.c b/mps/code/amcssth.c index 911c9977251..e5ed673c80c 100644 --- a/mps/code/amcssth.c +++ b/mps/code/amcssth.c | |||
| @@ -313,6 +313,8 @@ static void *fooey(void* childIsFinishedReturn) | |||
| 313 | int main(int argc, char *argv[]) | 313 | int main(int argc, char *argv[]) |
| 314 | { | 314 | { |
| 315 | mps_thr_t thread; | 315 | mps_thr_t thread; |
| 316 | mps_root_t reg_root; | ||
| 317 | void *marker = ▮ | ||
| 316 | pthread_t pthread1; | 318 | pthread_t pthread1; |
| 317 | void *r; | 319 | void *r; |
| 318 | int childIsFinished = 0; | 320 | int childIsFinished = 0; |
| @@ -324,8 +326,11 @@ int main(int argc, char *argv[]) | |||
| 324 | mps_message_type_enable(arena, mps_message_type_gc()); | 326 | mps_message_type_enable(arena, mps_message_type_gc()); |
| 325 | init(); | 327 | init(); |
| 326 | die(mps_thread_reg(&thread, arena), "thread_reg"); | 328 | die(mps_thread_reg(&thread, arena), "thread_reg"); |
| 329 | die(mps_root_create_reg(®_root, arena, mps_rank_ambig(), 0, thread, | ||
| 330 | mps_stack_scan_ambig, marker, 0), "root_create"); | ||
| 327 | pthread_create(&pthread1, NULL, fooey, (void *)&childIsFinished); | 331 | pthread_create(&pthread1, NULL, fooey, (void *)&childIsFinished); |
| 328 | mps_tramp(&r, test, arena, 0); | 332 | mps_tramp(&r, test, arena, 0); |
| 333 | mps_root_destroy(reg_root); | ||
| 329 | mps_thread_dereg(thread); | 334 | mps_thread_dereg(thread); |
| 330 | 335 | ||
| 331 | while (!childIsFinished) { | 336 | while (!childIsFinished) { |