Beispiel #1
0
void
ipc_mqueue_init(
	ipc_mqueue_t	mqueue)
{
	imq_lock_init(mqueue);
	ipc_kmsg_queue_init(&mqueue->imq_messages);
	ipc_thread_queue_init(&mqueue->imq_threads);
}
Beispiel #2
0
void
ipc_port_init(
	ipc_port_t	port,
	ipc_space_t	space,
	mach_port_name_t	name)
{
	/* port->ip_kobject doesn't have to be initialized */

	port->ip_receiver = space;
	port->ip_receiver_name = name;

	port->ip_mscount = 0;
	port->ip_srights = 0;
	port->ip_sorights = 0;

	port->ip_nsrequest = IP_NULL;
	port->ip_pdrequest = IP_NULL;
	port->ip_dnrequests = IPR_NULL;

	port->ip_pset = IPS_NULL;
	port->ip_seqno = 0;
	port->ip_msgcount = 0;
	port->ip_qlimit = MACH_PORT_QLIMIT_DEFAULT;
	port->ip_subsystem = RPC_SUBSYSTEM_NULL;
	
	port->ip_flags = 0;
	port->ip_context = 0;

	/*
	 *	Turn no more senders detection on
	 *	for all ports.  Eventually, this
	 *	default will go away, and nms
	 *	detection will be enabled depending
	 *	on how the port is allocated. XXX
	 */
	IP_SET_NMS(port);

#if	MACH_ASSERT
	ipc_port_init_debug(port);
#endif	/* MACH_ASSERT */

	ipc_mqueue_init(&port->ip_messages);
	thread_pool_init(&port->ip_thread_pool);
	ipc_thread_queue_init(&port->ip_blocked);
}