VisionCam_3A_Export::~VisionCam_3A_Export() { nAllocatinSize = 0; bSettingsHeld = false_e; mutex_deinit(&mLock); list_destroy( mSettingList ); delete execSRVC; }
void thread_main_func_translate(uint32_t argc, void* argv) { thread_t sosal_thread_hdl = argv; /* Run client main func */ sosal_thread_hdl->exit_code = sosal_thread_hdl->client_func(sosal_thread_hdl->client_arg); sosal_thread_hdl->bTaskReady = true_e; #ifdef JOIN_SEMAPHORE { semaphore_t *semaphore_hdl; semaphore_hdl = sosal_thread_hdl->join_semaphore; SOSAL_PRINT(SOSAL_ZONE_THREAD, "thread_main_func_translate semaphore post (%d)\n", sosal_thread_hdl->join_number); while(sosal_thread_hdl->join_number) { semaphore_post(semaphore_hdl); /* signal next join task in the queue to continue */ sosal_thread_hdl->join_number--; } SOSAL_PRINT(SOSAL_ZONE_THREAD, "thread_main_func_translate semaphore delete (%d)\n", sosal_thread_hdl->join_number); semaphore_delete(semaphore_hdl); mutex_deinit(sosal_thread_hdl->join_mutex); } /* extra task memory releasing */ free(sosal_thread_hdl->join_semaphore); sosal_thread_hdl->join_semaphore = NULL; free(sosal_thread_hdl->join_mutex); #else /* Event mode signaling */ //SOSAL_PRINT(SOSAL_ZONE_THREAD, "thread_main_func_translate send ready event\n"); event_set(sosal_thread_hdl->exit_event); // Wait all task to receive join event while (sosal_thread_hdl->pAckList) { ack_t *pAck; pAck = sosal_thread_hdl->pAckList; //SOSAL_PRINT(SOSAL_ZONE_THREAD, "thread_main_func_translate waits for ack\n"); event_wait(pAck->exit_event_ack, EVENT_FOREVER); SOSAL_PRINT(SOSAL_ZONE_THREAD, "thread_main_func_translate ack received\n"); sosal_thread_hdl->pAckList = pAck->next; sosal_free_ack(pAck); } event_deinit(sosal_thread_hdl->exit_event); //SOSAL_PRINT(SOSAL_ZONE_THREAD, "thread_main_func_translate event deinited\n"); /* extra task memory releasing */ free(sosal_thread_hdl->exit_event); #endif free(sosal_thread_hdl); sosal_thread_hdl = NULL; SOSAL_PRINT(SOSAL_ZONE_THREAD, "thread_main_func_translate clean up\n"); }
FDRenderer::~FDRenderer() { mutex_lock(&mLock); if (mFile != NULL) { fclose(mFile); mFile = NULL; // just for cleanliness' sake } delete mSurface; mSurface = NULL; mutex_unlock(&mLock); mutex_deinit(&mLock); }
/** @fn DataBuffer_t::~DataBuffer_t() */ DataBuffer_t::~DataBuffer_t() { mutex_deinit(&mBuffLock); #ifndef DVP_USE_ION FREE_IF_PRESENT( pData ) #else allocator_free(pAllocator, ALLOCATOR_MEMORY_TYPE_TILED_1D_UNCACHED, 1, &pData, handles); allocator_deinit(&pAllocator); #endif // DVP_USE_ION }
void thread_deinit(vm_t vm, thread_t t) { /*vm_printf("thread deinit %p\n",t);*/ if(t->state==ThreadZombie) { if(t->sched_data.prev) { t->sched_data.prev->next = t->sched_data.next; } else { vm->zombie_threads.head = t->sched_data.next; } if(t->sched_data.next) { t->sched_data.next->prev = t->sched_data.prev; } else { vm->zombie_threads.tail = t->sched_data.prev; } } mutex_deinit(&t->join_mutex); gstack_deinit(&t->closures_stack,NULL); /*assert(t->locals_stack.sp==(word_t)-1);*/ gstack_deinit(&t->locals_stack,NULL); gstack_deinit(&t->data_stack,NULL); gstack_deinit(&t->call_stack,NULL); /* FIXME : deref df_callee's */ gstack_deinit(&t->catch_stack,NULL); }
void mutex_delete(vm_t vm, mutex_t m) { /* should it kill pending threads ? */ mutex_deinit(m); free(m); }