asst1-Synchronization/kern/asst1/client_server.c
void work_queue_enqueue(request_t *req)
{
        lock_acquire(new_lock);
        // add request to a node in the queue
        struct node *new_node = kmalloc(sizeof(struct node));
        new_node->request = req;
        new_node->next = NULL;
        if (new_queue->head == NULL)
                new_queue->head = new_node;
        if (new_queue->current == NULL)
                new_queue->current = new_node;
        if (new_queue->tail != NULL)
                new_queue->tail->next = new_node;
        new_queue->tail = new_node;
        cv_signal(empty, new_lock);
        lock_release(new_lock);
}
/* work_queue_enqueue():
 *
 * req: A pointer to a request to be processed. You can assume it is
 * a valid pointer or NULL. You can't assume anything about what it
 * points to, i.e. the internals of the request type.
 *
 * This function is expected to add requests to a single queue for
 * processing. The queue is a queue (FIFO). The function then returns
 * to the caller. It can be called concurrently by multiple threads.
 *
 * Note: The above is a high-level description of behaviour, not
 * detailed psuedo code. Depending on your implementation, more or
 * less code may be required.
 */
A pointer to a request to be processed. You can assume it is
a valid pointer or NULL. You can't assume anything about what it
points to, i.e. the internals of the request type.

This function is expected to add requests to a single queue for
processing. The queue is a queue (FIFO). The function then returns
to the caller. It can be called concurrently by multiple threads.

The above is a high-level description of behaviour, not
detailed psuedo code. Depending on your implementation, more or
less code may be required.
A pointer to a request to be processed . You can assume it is a valid pointer or NULL . You can ' t assume anything about what it points to i . e . the internals of the request type . This function is expected to add requests to a single queue for processing . The queue is a queue ( FIFO ) . The function then returns to the caller . It can be called concurrently by multiple threads . The above is a high - level description of behaviour not detailed psuedo code . Depending on your implementation more or less code may be required .
void work_queue_enqueue(request_t *req)
{
        lock_acquire(new_lock);
        struct node *new_node = kmalloc(sizeof(struct node));
        new_node->request = req;
        new_node->next = NULL;
        if (new_queue->head == NULL)
                new_queue->head = new_node;
        if (new_queue->current == NULL)
                new_queue->current = new_node;
        if (new_queue->tail != NULL)
                new_queue->tail->next = new_node;
        new_queue->tail = new_node;
        cv_signal(empty, new_lock);
        lock_release(new_lock);
}
void work_queue_enqueue ( request_t * req ) { lock_acquire ( new_lock ) ; struct node * new_node = kmalloc ( sizeof ( struct node ) ) ; new_node -> request = req ; new_node -> next = NULL ; if ( new_queue -> head == NULL ) new_queue -> head = new_node ; if ( new_queue -> current == NULL ) new_queue -> current = new_node ; if ( new_queue -> tail != NULL ) new_queue -> tail -> next = new_node ; new_queue -> tail = new_node ; cv_signal ( empty , new_lock ) ; lock_release ( new_lock ) ; }
work_queue_enqueue():
 req: A pointer to a request to be processed.
work_queue_enqueue () : req : A pointer to a request to be processed .
// add request to a node in the queue