diff options
Diffstat (limited to 'src/mesa/pipe/cell/ppu/cell_spu.c')
-rw-r--r-- | src/mesa/pipe/cell/ppu/cell_spu.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_spu.c b/src/mesa/pipe/cell/ppu/cell_spu.c index a7dbf24dd8..44ad3f22b3 100644 --- a/src/mesa/pipe/cell/ppu/cell_spu.c +++ b/src/mesa/pipe/cell/ppu/cell_spu.c @@ -195,31 +195,22 @@ test_spus(struct cell_context *cell) /** - * Wait for all SPUs to exit/return. - */ -void -wait_spus(uint num_spus) -{ - uint i; - void *value; - - for (i = 0; i < num_spus; i++) { - pthread_join(cell_global.spe_threads[i], &value); - } -} - - -/** * Tell all the SPUs to stop/exit. */ void cell_spu_exit(struct cell_context *cell) { - unsigned i; + uint i; for (i = 0; i < cell->num_spus; i++) { send_mbox_message(cell_global.spe_contexts[i], CELL_CMD_EXIT); } - wait_spus(cell->num_spus); + /* wait for threads to exit */ + for (i = 0; i < cell->num_spus; i++) { + void *value; + pthread_join(cell_global.spe_threads[i], &value); + cell_global.spe_threads[i] = 0; + cell_global.spe_contexts[i] = 0; + } } |