asst1-Synchronization/kern/asst1/client_server.c
int work_queue_setup(void)
{
        new_queue = kmalloc(sizeof(struct queue));
        empty = cv_create("empty");
        new_lock = lock_create("new_lock");
        if (empty == NULL || new_lock == NULL || new_queue == NULL)
                return ENOSYS;
        // initialize queue
        new_queue->head = NULL;
        new_queue->tail = NULL;
        new_queue->current = NULL;
        return 0;
}
/*
 * work_queue_setup():
 *
 * This function is called before the client and server threads are started. It is
 * intended for you to initialise any globals or synchronisation
 * primitives that are needed by your solution.
 *
 * In returns zero on success, or non-zero on failure.
 *
 * You can assume it is not called concurrently.
 */
This function is called before the client and server threads are started. It is
intended for you to initialise any globals or synchronisation
primitives that are needed by your solution.

In returns zero on success, or non-zero on failure.

You can assume it is not called concurrently.
This function is called before the client and server threads are started . It is intended for you to initialise any globals or synchronisation primitives that are needed by your solution . In returns zero on success or non - zero on failure . You can assume it is not called concurrently .
int work_queue_setup(void)
{
        new_queue = kmalloc(sizeof(struct queue));
        empty = cv_create("empty");
        new_lock = lock_create("new_lock");
        if (empty == NULL || new_lock == NULL || new_queue == NULL)
                return ENOSYS;
        new_queue->head = NULL;
        new_queue->tail = NULL;
        new_queue->current = NULL;
        return 0;
}
int work_queue_setup ( void ) { new_queue = kmalloc ( sizeof ( struct queue ) ) ; empty = cv_create ( " " ) ; new_lock = lock_create ( " " ) ; if ( empty == NULL || new_lock == NULL || new_queue == NULL ) return ENOSYS ; new_queue -> head = NULL ; new_queue -> tail = NULL ; new_queue -> current = NULL ; return 0 ; }
work_queue_setup():
 This function is called before the client and server threads are started.
work_queue_setup () : This function is called before the client and server threads are started .
// initialize queue