Path: blob/main/cddl/compat/opensolaris/include/thread_pool.h
39488 views
/*1* CDDL HEADER START2*3* The contents of this file are subject to the terms of the4* Common Development and Distribution License (the "License").5* You may not use this file except in compliance with the License.6*7* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE8* or http://www.opensolaris.org/os/licensing.9* See the License for the specific language governing permissions10* and limitations under the License.11*12* When distributing Covered Code, include this CDDL HEADER in each13* file and include the License file at usr/src/OPENSOLARIS.LICENSE.14* If applicable, add the following below this CDDL HEADER, with the15* fields enclosed by brackets "[]" replaced with your own identifying16* information: Portions Copyright [yyyy] [name of copyright owner]17*18* CDDL HEADER END19*/2021/*22* Copyright 2006 Sun Microsystems, Inc. All rights reserved.23* Use is subject to license terms.24*/2526/*27*/2829#ifndef _THREAD_POOL_H_30#define _THREAD_POOL_H_3132#pragma ident "%Z%%M% %I% %E% SMI"3334#include <sys/types.h>35#include <thread.h>36#include <pthread.h>3738#ifdef __cplusplus39extern "C" {40#endif4142typedef struct tpool tpool_t; /* opaque thread pool descriptor */4344#if defined(__STDC__)4546extern tpool_t *tpool_create(uint_t min_threads, uint_t max_threads,47uint_t linger, pthread_attr_t *attr);48extern int tpool_dispatch(tpool_t *tpool,49void (*func)(void *), void *arg);50extern void tpool_destroy(tpool_t *tpool);51extern void tpool_abandon(tpool_t *tpool);52extern void tpool_wait(tpool_t *tpool);53extern void tpool_suspend(tpool_t *tpool);54extern int tpool_suspended(tpool_t *tpool);55extern void tpool_resume(tpool_t *tpool);56extern int tpool_member(tpool_t *tpool);5758#else /* Non ANSI */5960extern tpool_t *tpool_create();61extern int tpool_dispatch();62extern void tpool_destroy();63extern void tpool_abandon();64extern void tpool_wait();65extern void tpool_suspend();66extern int tpool_suspended();67extern void tpool_resume();68extern int tpool_member();6970#endif /* __STDC__ */7172#ifdef __cplusplus73}74#endif7576#endif /* _THREAD_POOL_H_ */777879