summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/cell/ppu/cell_spu.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-10 09:13:10 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-10 11:26:20 -0700
commitd07b86dedfd87ed7c301fa81242314c891031693 (patch)
tree38992400a5cd276e783892bca5ad9506fa150085 /src/mesa/pipe/cell/ppu/cell_spu.c
parente6b33b6f35ab2f7b240ac902cc748d8e1a2fd4ef (diff)
Cell: clean-up cell_spu_exit() code
Diffstat (limited to 'src/mesa/pipe/cell/ppu/cell_spu.c')
-rw-r--r--src/mesa/pipe/cell/ppu/cell_spu.c25
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;
+ }
}