Exemplo n.º 1
0
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);	
}
Exemplo n.º 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);
}
Exemplo n.º 3
0
void
lock_destroy(struct lock *lock)
{
    kfree(lock->lk_name);
    wchan_destroy(lock->lk_wchan);
    spinlock_cleanup(&lock->spin_lock);
    kfree(lock);
}
Exemplo n.º 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);
}
Exemplo n.º 5
0
void
cv_destroy(struct cv *cv)
{
        KASSERT(cv != NULL);

	wchan_destroy(cv->cv_wchan);        
        kfree(cv->cv_name);
        kfree(cv);
}
Exemplo n.º 6
0
Arquivo: synch.c Projeto: 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);
}
Exemplo n.º 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);
}
Exemplo n.º 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);
}
Exemplo n.º 9
0
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);
}
Exemplo n.º 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);
}
Exemplo n.º 11
0
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);
}
Exemplo n.º 12
0
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);
}
Exemplo n.º 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);
}
Exemplo n.º 14
0
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);
}
Exemplo n.º 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);
}
Exemplo n.º 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);
}
Exemplo n.º 17
0
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);
}
Exemplo n.º 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);
}
Exemplo n.º 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
}
Exemplo n.º 20
0
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;
       
        
}
Exemplo n.º 21
0
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
}