00001 /*<std-header orig-src='shore' incl-file-exclusion='STCORE_PTHREAD_H'> 00002 00003 $Id: stcore_pthread.h,v 1.11 2012/01/02 17:02:22 nhall Exp $ 00004 00005 SHORE -- Scalable Heterogeneous Object REpository 00006 00007 Copyright (c) 1994-99 Computer Sciences Department, University of 00008 Wisconsin -- Madison 00009 All Rights Reserved. 00010 00011 Permission to use, copy, modify and distribute this software and its 00012 documentation is hereby granted, provided that both the copyright 00013 notice and this permission notice appear in all copies of the 00014 software, derivative works or modified versions, and any portions 00015 thereof, and that both notices appear in supporting documentation. 00016 00017 THE AUTHORS AND THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY 00018 OF WISCONSIN - MADISON ALLOW FREE USE OF THIS SOFTWARE IN ITS 00019 "AS IS" CONDITION, AND THEY DISCLAIM ANY LIABILITY OF ANY KIND 00020 FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 00021 00022 This software was developed with support by the Advanced Research 00023 Project Agency, ARPA order number 018 (formerly 8230), monitored by 00024 the U.S. Army Research Laboratory under contract DAAB07-91-C-Q518. 00025 Further funding for this work was provided by DARPA through 00026 Rome Research Laboratory Contract No. F30602-97-2-0247. 00027 00028 */ 00029 00030 #ifndef STCORE_PTHREAD_H 00031 #define STCORE_PTHREAD_H 00032 00033 #include "w_defines.h" 00034 00035 /* -- do not edit anything above this line -- </std-header>*/ 00036 00037 /* 00038 * NewThreads is Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998 by: 00039 * 00040 * Josef Burger <bolo@cs.wisc.edu> 00041 * Dylan McNamee <dylan@cse.ogi.edu> 00042 * Ed Felten <felten@cs.princeton.edu> 00043 * 00044 * All Rights Reserved. 00045 * 00046 * NewThreads may be freely used as long as credit is given 00047 * to the above authors and the above copyright is maintained. 00048 */ 00049 00050 #include <w_pthread.h> 00051 00052 /**\cond skip */ 00053 typedef struct sthread_core_t { 00054 int is_virgin; /* TRUE if just started */ 00055 void (*start_proc)(void *); /* thread start function */ 00056 void *start_arg; /* argument for start_proc */ 00057 int stack_size; /* stack size */ 00058 void *sthread; /* sthread which uses this core */ 00059 pthread_t pthread; 00060 pthread_t creator; /* thread that created this pthread, for 00061 debugging only */ 00062 } sthread_core_t; 00063 /**\endcond skip */ 00064 00065 ostream &operator<<(ostream &o, const sthread_core_t &core); 00066 00067 extern int sthread_core_init(sthread_core_t* t, 00068 void (*proc)(void *), void *arg, 00069 unsigned stack_size); 00070 00071 extern void sthread_core_exit(sthread_core_t *t, bool &joined); 00072 00073 /*<std-footer incl-file-exclusion='STCORE_PTHREAD_H'> -- do not edit anything below this line -- */ 00074 00075 #endif /*</std-footer>*/