ev_waits.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright 2003 by Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 1996-1999 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/* ev_waits.c - implement deferred function calls for the eventlib
* vix 05dec95 [initial]
*/
#if !defined(LINT) && !defined(CODECENTER)
static const char rcsid[] = "$Id: ev_waits.c,v 8.12 2002/07/08 05:50:10 marka Exp $";
#endif
#include "port_before.h"
#include "fd_setsize.h"
#include <errno.h>
#include <isc/eventlib.h>
#include <isc/assertions.h>
#include "eventlib_p.h"
#include "port_after.h"
/* Forward. */
/* Public. */
/*
* Enter a new wait function on the queue.
*/
int
{
else
return (0);
}
/*
* Mark runnable all waiting functions having a certain tag.
*/
int
if (!wl) {
return (-1);
}
else
return (0);
}
/*
* Remove a waiting (or ready to run) function from the queue.
*/
int
evWaitList *wl;
int found = 0;
found = 1;
else
break;
}
}
if (!found) {
/* Maybe it's done */
found = 1;
else
break;
}
}
if (!found) {
return (-1);
}
return (0);
}
int
else
return (0);
}
/* Private. */
static void
evWaitList *wl;
}
}
static evWaitList *
return (NULL);
return (new);
}
static void
else
}
static evWaitList *
break;
}
return (this);
}