static void radeon_winsys_destroy(struct radeon_winsys *rws) { struct radeon_drm_winsys *ws = (struct radeon_drm_winsys*)rws; if (ws->thread) { ws->kill_thread = 1; pipe_semaphore_signal(&ws->cs_queued); pipe_thread_wait(ws->thread); } pipe_semaphore_destroy(&ws->cs_queued); pipe_condvar_destroy(ws->cs_queue_empty); if (!pipe_reference(&ws->base.reference, NULL)) { return; } pipe_mutex_destroy(ws->hyperz_owner_mutex); pipe_mutex_destroy(ws->cmask_owner_mutex); pipe_mutex_destroy(ws->cs_stack_lock); ws->cman->destroy(ws->cman); ws->kman->destroy(ws->kman); if (ws->gen >= DRV_R600) { radeon_surface_manager_free(ws->surf_man); } if (fd_tab) { util_hash_table_remove(fd_tab, intptr_to_pointer(ws->fd)); } FREE(rws); }
void util_ringbuffer_destroy( struct util_ringbuffer *ring ) { pipe_condvar_destroy(ring->change); pipe_mutex_destroy(ring->mutex); FREE(ring->buf); FREE(ring); }
/** Destroy a fence. Called when refcount hits zero. */ void lp_fence_destroy(struct lp_fence *fence) { if (LP_DEBUG & DEBUG_FENCE) debug_printf("%s %d\n", __FUNCTION__, fence->id); pipe_mutex_destroy(fence->mutex); pipe_condvar_destroy(fence->signalled); FREE(fence); }