/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <thread.h>
#include <synch.h>
#include <syslog.h>
#include <slp-internal.h>
#include <slp_net_utils.h>
return (SLP_PARAMETER_BAD);
}
/* allocate the handle */
return (SLP_MEMORY_ALLOC_FAILED);
}
/* initialize outcall synchronization */
hp->consumer_tid = 0;
/* locale property overrides argument */
}
/* Make sure the language string is under our ownership */
return (SLP_MEMORY_ALLOC_FAILED);
}
/* Asynchronous operation? */
if (isAsync)
else
/* TCP vars -- these are NULL until actually needed */
hp->tcp_ref_cnt = 0;
/* Consumer / Producer pipe */
/* Interface info, loaded on demand */
/* force multicast, false by default */
/* internal call, false by default */
return (SLP_OK);
}
/* free the handle */
}
}
if (!hSLP) {
return;
}
/*
* If an outcall is pending on this handle:
* If we are being called from a callback resulting
* from the outcall associated with this handle or
* if close_on_end has already been set:
* just set close on end and return -- the cleanup
* will be done when the outcall is finished.
* else
* wait on the outcall cv for the outcall to complete
* Proceed with cleanup
*/
if (hp->pending_outcall) {
/* end the consumer thread */
/* this will also kill the producer thread and close net */
if (hp->q) {
goto cleanup;
}
}
/* SLPClose called from callback */
return;
}
/* else not called from callback; wait for outcall to end */
while (hp->pending_outcall) {
}
}
}