X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2f810149832a2d855c33d0df5b02d736c2081e41..f2ab03c68105029c71a20ae3363cfdfc950a5c90:/src/xbt/xbt_queue.c diff --git a/src/xbt/xbt_queue.c b/src/xbt/xbt_queue.c index 76a828c046..68be624238 100644 --- a/src/xbt/xbt_queue.c +++ b/src/xbt/xbt_queue.c @@ -1,7 +1,7 @@ /* A (synchronized) message queue. */ /* Popping an empty queue is blocking, as well as pushing a full one */ -/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team. +/* Copyright (c) 2007-2014. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -11,10 +11,9 @@ #include "xbt/sysdep.h" #include "xbt/log.h" #include "xbt/dynar.h" +#include "xbt/synchro_core.h" -#include "xbt/synchro.h" #include "xbt/queue.h" /* this module */ -#include "gras/virtu.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_queue, xbt, "Message exchanging queue"); @@ -80,7 +79,7 @@ void xbt_queue_push(xbt_queue_t queue, const void *src) xbt_mutex_acquire(queue->mutex); while (queue->capacity != 0 && queue->capacity == xbt_dynar_length(queue->data)) { - XBT_DEBUG("Capacity of %p exceded (=%d). Waiting", queue, + XBT_DEBUG("Capacity of %p exceeded (=%d). Waiting", queue, queue->capacity); xbt_cond_wait(queue->not_full, queue->mutex); } @@ -120,7 +119,7 @@ void xbt_queue_unshift(xbt_queue_t queue, const void *src) xbt_mutex_acquire(queue->mutex); while (queue->capacity != 0 && queue->capacity == xbt_dynar_length(queue->data)) { - XBT_DEBUG("Capacity of %p exceded (=%d). Waiting", queue, + XBT_DEBUG("Capacity of %p exceeded (=%d). Waiting", queue, queue->capacity); xbt_cond_wait(queue->not_full, queue->mutex); } @@ -168,7 +167,7 @@ void xbt_queue_push_timed(xbt_queue_t queue, const void *src, double delay) xbt_mutex_release(queue->mutex); THROWF(timeout_error, 0, - "Capacity of %p exceded (=%d), and delay = 0", queue, + "Capacity of %p exceeded (=%d), and delay = 0", queue, queue->capacity); } } else { @@ -176,7 +175,7 @@ void xbt_queue_push_timed(xbt_queue_t queue, const void *src, double delay) queue->capacity == xbt_dynar_length(queue->data) && (delay < 0 || (xbt_time() - begin) <= delay)) { - XBT_DEBUG("Capacity of %p exceded (=%d). Waiting", queue, + XBT_DEBUG("Capacity of %p exceeded (=%d). Waiting", queue, queue->capacity); TRY { xbt_cond_timedwait(queue->not_full, queue->mutex, @@ -248,7 +247,7 @@ void xbt_queue_unshift_timed(xbt_queue_t queue, const void *src, xbt_mutex_release(queue->mutex); THROWF(timeout_error, 0, - "Capacity of %p exceded (=%d), and delay = 0", queue, + "Capacity of %p exceeded (=%d), and delay = 0", queue, queue->capacity); } } else { @@ -256,7 +255,7 @@ void xbt_queue_unshift_timed(xbt_queue_t queue, const void *src, queue->capacity == xbt_dynar_length(queue->data) && (delay < 0 || (xbt_time() - begin) <= delay)) { - XBT_DEBUG("Capacity of %p exceded (=%d). Waiting", queue, + XBT_DEBUG("Capacity of %p exceeded (=%d). Waiting", queue, queue->capacity); TRY { xbt_cond_timedwait(queue->not_full, queue->mutex,