void NaClAppThreadDelete(struct NaClAppThread *natp) { /* * the thread must not be still running, else this crashes the system */ if (natp->host_thread_is_defined) { NaClThreadDtor(&natp->host_thread); } free(natp->suspended_registers); NaClMutexDtor(&natp->suspend_mu); NaClSignalStackFree(natp->signal_stack); natp->signal_stack = NULL; NaClTlsFree(natp); NaClMutexDtor(&natp->mu); NaClAlignedFree(natp); }
void NaClAppThreadDtor(struct NaClAppThread *natp) { /* * the thread must not be still running, else this crashes the system */ /* * Notify the debug stub that we are done with this thread */ NaClDebugThreadStopDebugging(natp); NaClThreadDtor(&natp->thread); NaClSignalStackUnregister(); NaClSignalStackFree(natp->signal_stack); natp->signal_stack = NULL; NaClClosureResultDtor(&natp->result); (*natp->effp->vtbl->Dtor)(natp->effp); free(natp->effp); natp->effp = NULL; NaClTlsFree(natp); NaClCondVarDtor(&natp->cv); NaClMutexDtor(&natp->mu); }