static int clist_start_render_thread(gx_device *dev, int thread_index, int band) { gx_device_clist *cldev = (gx_device_clist *)dev; gx_device_clist_reader *crdev = &cldev->reader; int code; crdev->render_threads[thread_index].band = band; crdev->render_threads[thread_index].status = THREAD_BUSY; /* Finally, fire it up */ code = gp_thread_start(clist_render_thread, &(crdev->render_threads[thread_index]), &(crdev->render_threads[thread_index].thread)); return code; }
int clist_enable_multi_thread_render(gx_device *dev) { int code = -1; gp_thread_id thread; /* We need to test gp_thread_start since we may be on a platform */ /* built without working threads, i.e., using gp_nsync.c dummy */ /* routines. The nosync gp_thread_start returns a -ve error code. */ if ((code = gp_thread_start(test_threads, NULL, &thread)) < 0 ) { return code; /* Threads don't work */ } gp_thread_finish(thread); set_dev_proc(dev, get_bits_rectangle, clist_get_bits_rect_mt); return 1; }