asst1-Synchronization/kern/asst1/client_server.c
void work_queue_shutdown(void)
{
        cv_destroy(empty);
        lock_destroy(new_lock);
        // free the node in queue
        while (new_queue->head != NULL) {
                struct node *curr = new_queue->head;
                new_queue->head = new_queue->head->next;
                kfree(curr);
        }
        kfree(new_queue);

}
/*
 * work_queue_shutdown():
 *
 * This function is called after the participating threads have
 * exited. Use it to de-allocate or "destroy" anything allocated or created
 * on setup.
 *
 * You can assume it is not called concurrently.
 */
This function is called after the participating threads have
exited. Use it to de-allocate or "destroy" anything allocated or created
on setup.

You can assume it is not called concurrently.
This function is called after the participating threads have exited . Use it to de - allocate or " destroy " anything allocated or created on setup . You can assume it is not called concurrently .
void work_queue_shutdown(void)
{
        cv_destroy(empty);
        lock_destroy(new_lock);
        while (new_queue->head != NULL) {
                struct node *curr = new_queue->head;
                new_queue->head = new_queue->head->next;
                kfree(curr);
        }
        kfree(new_queue);
}
void work_queue_shutdown ( void ) { cv_destroy ( empty ) ; lock_destroy ( new_lock ) ; while ( new_queue -> head != NULL ) { struct node * curr = new_queue -> head ; new_queue -> head = new_queue -> head -> next ; kfree ( curr ) ; } kfree ( new_queue ) ; }
work_queue_shutdown():
 This function is called after the participating threads have
 exited.
work_queue_shutdown () : This function is called after the participating threads have exited .
// free the node in queue