From: <dg...@su...> - 2009-02-02 23:38:58
|
Author: Graham Cobb Date: Tue Feb 3 00:37:13 2009 New Revision: 5252 URL: http://www.opensync.org/changeset/5252 Log: Add minimum value for pending queue timeout. Modified: branches/timeout/ChangeLog branches/timeout/opensync/ipc/opensync_queue.c branches/timeout/opensync/ipc/opensync_queue_private.h branches/timeout/tests/ipc-tests/check_ipc.c Modified: branches/timeout/ChangeLog ============================================================================== --- branches/timeout/ChangeLog Sun Feb 1 19:57:43 2009 (r5251) +++ branches/timeout/ChangeLog Tue Feb 3 00:37:13 2009 (r5252) @@ -1,3 +1,11 @@ +2009-02-02 Graham Cobb <g+...@co...> + + * opensync/ipc/opensync_queue_private.h (OSYNC_QUEUE_PENDING_QUEUE_MIN_TIMEOUT): Define + minimum pending queue timeout. + + * opensync/ipc/opensync_queue.c (_osync_queue_restart_pending_timeout): Apply + minimum value to pending queue timeout. + 2009-02-01 Graham Cobb <g+...@co...> * tests/ipc-tests/check_ipc.c: Add ipc_timeout_noreceiver test. Modified: branches/timeout/opensync/ipc/opensync_queue.c ============================================================================== --- branches/timeout/opensync/ipc/opensync_queue.c Sun Feb 1 19:57:43 2009 (r5251) +++ branches/timeout/opensync/ipc/opensync_queue.c Tue Feb 3 00:37:13 2009 (r5252) @@ -268,8 +268,12 @@ by the caller before calling this function */ if (queue->max_timeout) { + unsigned int timeout; + timeout = queue->max_timeout + OSYNC_QUEUE_PENDING_QUEUE_IPC_DELAY; + if (timeout < OSYNC_QUEUE_PENDING_QUEUE_MIN_TIMEOUT) + timeout = OSYNC_QUEUE_PENDING_QUEUE_MIN_TIMEOUT; g_source_get_current_time(queue->timeout_source, &queue->pending_timeout); - queue->pending_timeout.tv_sec += queue->max_timeout + OSYNC_QUEUE_PENDING_QUEUE_IPC_DELAY; + queue->pending_timeout.tv_sec += timeout; } } Modified: branches/timeout/opensync/ipc/opensync_queue_private.h ============================================================================== --- branches/timeout/opensync/ipc/opensync_queue_private.h Sun Feb 1 19:57:43 2009 (r5251) +++ branches/timeout/opensync/ipc/opensync_queue_private.h Tue Feb 3 00:37:13 2009 (r5252) @@ -111,6 +111,9 @@ */ #define OSYNC_QUEUE_PENDING_QUEUE_IPC_DELAY 1 +/** @brief Pending queue minimum timeout + */ +#define OSYNC_QUEUE_PENDING_QUEUE_MIN_TIMEOUT 20 /** @brief Timeout object */ Modified: branches/timeout/tests/ipc-tests/check_ipc.c ============================================================================== --- branches/timeout/tests/ipc-tests/check_ipc.c Sun Feb 1 19:57:43 2009 (r5251) +++ branches/timeout/tests/ipc-tests/check_ipc.c Tue Feb 3 00:37:13 2009 (r5252) @@ -3086,7 +3086,8 @@ osync_message_unref(message); - g_usleep(4*G_USEC_PER_SEC); + /* Note: OSYNC_QUEUE_PENDING_QUEUE_MIN_TIMEOUT is 20 */ + g_usleep(25*G_USEC_PER_SEC); /* Check if the timeout handler replied with an error. Note: it is important we check **before** we start disconnecting |