asst1-Synchronization/kern/asst1/client_server.c
request_t *work_queue_get_next(void)
{
        lock_acquire(new_lock);
        // no requests waiting to be processed
        while(new_queue->current == NULL)
                cv_wait(empty, new_lock);
        request_t *req = new_queue->current->request;
        new_queue->current = new_queue->current->next;
        lock_release(new_lock);
        return req;
}
/*
 * work_queue_get_next():
 *
 * This function is expected to block on a synchronisation primitive
 * until there are one or more requests in the queue for processing.
 *
 * A pointer to the request is removed from the queue and returned to
 * the server.
 *
 * 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.
 */
This function is expected to block on a synchronisation primitive
until there are one or more requests in the queue for processing.

A pointer to the request is removed from the queue and returned to
the server.

The above is a high-level description of behaviour, not
detailed psuedo code. Depending on your implementation, more or
less code may be required.
This function is expected to block on a synchronisation primitive until there are one or more requests in the queue for processing . A pointer to the request is removed from the queue and returned to the server . The above is a high - level description of behaviour not detailed psuedo code . Depending on your implementation more or less code may be required .
request_t *work_queue_get_next(void)
{
        lock_acquire(new_lock);
        while(new_queue->current == NULL)
                cv_wait(empty, new_lock);
        request_t *req = new_queue->current->request;
        new_queue->current = new_queue->current->next;
        lock_release(new_lock);
        return req;
}
request_t * work_queue_get_next ( void ) { lock_acquire ( new_lock ) ; while ( new_queue -> current == NULL ) cv_wait ( empty , new_lock ) ; request_t * req = new_queue -> current -> request ; new_queue -> current = new_queue -> current -> next ; lock_release ( new_lock ) ; return req ; }
work_queue_get_next():
 This function is expected to block on a synchronisation primitive
 until there are one or more requests in the queue for processing.
work_queue_get_next () : This function is expected to block on a synchronisation primitive until there are one or more requests in the queue for processing .
// no requests waiting to be processed