thr.h revision 131431
1112899Sjeff/* 2112899Sjeff * Copyright (c) 2003, Jeffrey Roberson <jeff@freebsd.org> 3112899Sjeff * All rights reserved. 4112899Sjeff * 5112899Sjeff * Redistribution and use in source and binary forms, with or without 6112899Sjeff * modification, are permitted provided that the following conditions 7112899Sjeff * are met: 8112899Sjeff * 1. Redistributions of source code must retain the above copyright 9112899Sjeff * notice unmodified, this list of conditions, and the following 10112899Sjeff * disclaimer. 11112899Sjeff * 2. Redistributions in binary form must reproduce the above copyright 12112899Sjeff * notice, this list of conditions and the following disclaimer in the 13112899Sjeff * documentation and/or other materials provided with the distribution. 14112899Sjeff * 15112899Sjeff * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16112899Sjeff * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17112899Sjeff * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18112899Sjeff * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19112899Sjeff * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20112899Sjeff * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21112899Sjeff * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22112899Sjeff * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23112899Sjeff * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24112899Sjeff * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25112899Sjeff * 26112899Sjeff * $FreeBSD: head/sys/sys/thr.h 131431 2004-07-02 00:40:07Z marcel $ 27112899Sjeff * 28112899Sjeff */ 29112899Sjeff 30112899Sjeff#ifndef _SYS_THR_H_ 31112899Sjeff#define _SYS_THR_H_ 32112899Sjeff 33112899Sjeff#define THR_SUSPENDED 0x0001 /* Create the thread in the suspended state. */ 34112899Sjeff 35112899Sjeff/* 36112899Sjeff * See pthread_* 37112899Sjeff */ 38112899Sjeff#ifndef _KERNEL 39112899Sjeff 40131431Smarcelint thr_create(ucontext_t *ctx, long *id, int flags); 41131431Smarcelint thr_self(long *id); 42112899Sjeffvoid thr_exit(void); 43131431Smarcelint thr_kill(long id, int sig); 44127482Smtmint thr_suspend(const struct timespec *timeout); 45131431Smarcelint thr_wake(long id); 46112899Sjeff 47112899Sjeff#endif /* !_KERNEL */ 48112899Sjeff 49112899Sjeff#endif /* ! _SYS_THR_H_ */ 50