2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. 2N/A * Simple implementation of timeout functionality. The granuality is a sec 2N/A * LONG_SLEEP_TIME = (24 * 60 * 60 * NANOSEC) 2N/A * Invoke the callback function 2N/A /* LINTED - suppress E_FUNC_HAS_NO_RETURN_STMT (lint bug 7122677) */ 2N/A * In the very very unlikely case timer id wraps around and we have two timers 2N/A * with the same id. If that happens timer with the least amount of time left 2N/A * will be deleted. In case both timers have same time left than the one that 2N/A * was scheduled first will be deleted as it will be in the front of the list. 2N/A * Check if this is in the to-be run list 2N/A * Check if this is in the to-be scheduled list 2N/A * Schedule the next timeout 2N/A * Thread is holding the mutex. 2N/A * Get all the timeouts that have fired. 2N/A * We return from timedwait because we either timed out 2N/A * or a new element was added and we need to reset the time 2N/A * The init routine, starts the timer thread