예제 #1
0
파일: synch.c 프로젝트: nmanivas/OS161
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);	
}
예제 #2
0
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);
}
예제 #3
0
void
lock_destroy(struct lock *lock)
{
    kfree(lock->lk_name);
    wchan_destroy(lock->lk_wchan);
    spinlock_cleanup(&lock->spin_lock);
    kfree(lock);
}
예제 #4
0
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);
}
예제 #5
0
파일: synch.c 프로젝트: jamesidzik/Test
void
cv_destroy(struct cv *cv)
{
        KASSERT(cv != NULL);

	wchan_destroy(cv->cv_wchan);        
        kfree(cv->cv_name);
        kfree(cv);
}
예제 #6
0
파일: synch.c 프로젝트: simnic31/OS
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);
}
예제 #7
0
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);
}
예제 #8
0
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);
}
예제 #9
0
파일: synch.c 프로젝트: jamesidzik/Test
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);
}
예제 #10
0
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);
}
예제 #11
0
파일: synch.c 프로젝트: Asb10/doodi_os
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);
}
예제 #12
0
파일: cv.c 프로젝트: plurmiscuous/JinxOS
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);
}
예제 #13
0
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);
}
예제 #14
0
파일: synch.c 프로젝트: jmangue/os161
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);
}
예제 #15
0
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);
}
예제 #16
0
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);
}
예제 #17
0
파일: synch.c 프로젝트: HeliWang/cs350OS
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);
}
예제 #18
0
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);
}
예제 #19
0
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
}
예제 #20
0
파일: synch.c 프로젝트: hccyang/OS-system
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;
       
        
}
예제 #21
0
파일: synch.c 프로젝트: jcseto/os161-1.99
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
}