void rwlock_destroy(struct rwlock *rw) { KASSERT(rw != NULL); wchan_destroy(rw->rd_wchan); wchan_destroy(rw->wr_wchan); sem_destroy(rw->rw_sem); lock_destroy(rw->rw_lock); kfree(rw->rwlock_name); kfree(rw); }
void rwlock_destroy(struct rwlock *rwlock) { KASSERT(rwlock != NULL); //KASSERT(rwlock_do_i_hold(rwlock) == false); KASSERT(rwlock->rwlock_readers_count == 0); KASSERT(rwlock->is_held_by_writer == false); //kprintf("threadlist count: %d\n", rwlock->readers_list.tl_count); spinlock_cleanup(&rwlock->rwlock_spinlock); wchan_destroy(rwlock->rwlock_read_wchan); wchan_destroy(rwlock->rwlock_write_wchan); lock_destroy(rwlock->rwlock_write_lock); //cv_destroy(rwlock->rwlock_cv_lock); //threadlist_cleanup(&rwlock->readers_list); kfree(rwlock->rwlock_name); kfree(rwlock); }
void lock_destroy(struct lock *lock) { kfree(lock->lk_name); wchan_destroy(lock->lk_wchan); spinlock_cleanup(&lock->spin_lock); kfree(lock); }
void cv_destroy(struct cv *cv) { KASSERT(cv != NULL); kfree(cv->cv_name); wchan_destroy(cv->cv_wchan); spinlock_cleanup(&cv->spin_lock); kfree(cv); }
void cv_destroy(struct cv *cv) { KASSERT(cv != NULL); wchan_destroy(cv->cv_wchan); kfree(cv->cv_name); kfree(cv); }
void lock_destroy(struct lock *lock) { KASSERT(lock != NULL); spinlock_cleanup(&lock->lk_spinlock); wchan_destroy(lock->lk_wchan); kfree(lock->lk_name); kfree(lock); }
void sem_destroy(struct semaphore *sem) { KASSERT(sem != NULL); /* wchan_cleanup will assert if anyone's waiting on it */ spinlock_cleanup(&sem->sem_lock); wchan_destroy(sem->sem_wchan); kfree(sem->sem_name); kfree(sem); }
void cv_destroy(struct cv *cv) { KASSERT(cv != NULL); // add stuff here as needed spinlock_cleanup(&cv->cv_lock); wchan_destroy(cv->cv_wchan); kfree(cv->cv_name); kfree(cv); }
void lock_destroy(struct lock *lock) { KASSERT(lock != NULL); // add stuff here as needed spinlock_cleanup(&lock->lk_spinlock); wchan_destroy(lock->lk_wchan); kfree(lock->lk_name); kfree(lock); }
void cv_destroy(struct cv *cv) { KASSERT(cv != NULL); kfree(cv->cv_name); #if OPT_A1 wchan_destroy(cv->cv_wchan); cv->cv_wchan = NULL; #endif kfree(cv); }
void cv_destroy(struct cv *cv) { KASSERT(cv != NULL); // add stuff here as needed kfree(cv->cv_name); wchan_destroy(cv->cv_wchan); kfree(cv); }
void cv_destroy(struct cv* cv) { assert(cv != NULL); // wchan_cleanup will assert if anyone's waiting on it spinlock_cleanup(&cv->cv_splock); wchan_destroy(cv->cv_wchan); // provided code kfree(cv->cv_name); kfree(cv); }
void lock_destroy(struct lock *lock) { KASSERT(lock != NULL); KASSERT(lock_do_i_hold(lock) == false); // add stuff here as needed lock->lk_curthread = NULL; spinlock_cleanup(&lock->lk_spinlock); wchan_destroy(lock->lk_wchan); kfree(lock->lk_name); kfree(lock); }
void lock_destroy(struct lock *lk) { KASSERT(lk != NULL); KASSERT(lk->locked == false); // add stuff here as needed spinlock_cleanup(&lk->slock); wchan_destroy(lk->lock_wchan); kfree(lk->lk_name); kfree(lk); }
void cv_destroy(struct cv *mycv) { KASSERT(mycv != NULL); // add stuff here as needed wchan_destroy(mycv->cv_wchan); //end of added stuff kfree(mycv->cv_name); kfree(mycv); }
void lock_destroy(struct lock *lock) { KASSERT(lock != NULL); // add stuff here as needed #if OPT_A1 spinlock_cleanup(&lock->lock_lock); wchan_destroy(lock->lk_wchan); lock->lock_holder = NULL; #endif kfree(lock->lk_name); kfree(lock); }
void cv_destroy(struct cv *cv) { KASSERT(cv != NULL); #if OPT_A1 spinlock_cleanup(&cv->cv_spinlock); wchan_destroy(cv->cv_wchan); #endif kfree(cv->cv_name); kfree(cv); }
void lock_destroy(struct lock *mylock) { KASSERT(mylock != NULL); // add stuff here as needed spinlock_cleanup(&mylock->lk_spinlock); wchan_destroy(mylock->lk_wchan); //end of added stuff kfree(mylock->lk_name); kfree(mylock); }
void lock_destroy(struct lock *lock) { #if OPT_A1 KASSERT(lock != NULL); spinlock_cleanup(&lock->lk_spinlock); wchan_destroy(lock->lock_wchan); lock->lock_wchan = NULL; lock->initial_thread = NULL; kfree(lock->lk_name); kfree(lock); #else (void*)lock; #endif }
void lock_destroy(struct lock *lock) { KASSERT(lock != NULL); // add stuff here as needed spinlock_cleanup(&lock->splk); wchan_destroy(lock->lock_wchan); kfree(lock->lk_name); //kfree(lock->currentplace); kfree(lock); //lock = NULL; }
void cv_destroy(struct cv *cv) { KASSERT(cv != NULL); // add stuff here as needed #if OPT_A1 spinlock_cleanup(&(cv->cv_spinlock)); wchan_destroy(cv->cv_wchan); kfree(cv->cv_name); kfree(cv); #else kfree(cv->cv_name); kfree(cv); #endif }