threads.h

Go to the documentation of this file.
00001 
00002 /*  $Id: threads.h 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /******************************************************************************
00005 
00006     UserLand Frontier(tm) -- High performance Web content management,
00007     object database, system-level and Internet scripting environment,
00008     including source code editing and debugging.
00009 
00010     Copyright (C) 1992-2004 UserLand Software, Inc.
00011 
00012     This program is free software; you can redistribute it and/or modify
00013     it under the terms of the GNU General Public License as published by
00014     the Free Software Foundation; either version 2 of the License, or
00015     (at your option) any later version.
00016 
00017     This program is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020     GNU General Public License for more details.
00021 
00022     You should have received a copy of the GNU General Public License
00023     along with this program; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 ******************************************************************************/
00027 
00028 #ifndef threadsinclude
00029 #define threadsinclude
00030 
00031 
00032 #define idnullthread        ((hdlthread) 0)
00033 #define idcurrentthread     ((hdlthread) 1)
00034 #define idapplicationthread ((hdlthread) 2)
00035 
00036 
00037 typedef struct _thread * hdlthread;
00038 
00039 typedef void * tythreadmainparams;
00040 
00041 typedef pascal void * (*tythreadmaincallback) (tythreadmainparams);
00042 
00043 typedef void (*tythreadglobalscallback) (void *);
00044 
00045 typedef struct tythreadcallbacks {
00046 
00047     tythreadglobalscallback disposecallback;
00048     
00049     tythreadglobalscallback swapincallback;
00050     
00051     tythreadglobalscallback swapoutcallback;
00052     } tythreadcallbacks;
00053 
00054 /*globals*/
00055 
00056 extern tythreadcallbacks threadcallbacks;
00057 
00058 
00059 /*prototypes*/
00060 
00061 extern boolean canusethreads (void);
00062 
00063 extern boolean initmainthread (void *);
00064 
00065 extern boolean inmainthread (void);
00066 
00067 extern boolean attachtomainthread (long); /*6.2b7 AR*/
00068 
00069 extern boolean newthread (tythreadmaincallback, tythreadmainparams, void *, hdlthread *);
00070 
00071 extern boolean threadstartup (void);
00072 
00073 extern void threadshutdown (void);
00074 
00075 extern boolean threadsleep (hdlthread hthread);
00076 
00077 extern boolean threadissleeping (hdlthread);
00078 
00079 extern boolean threadwake (hdlthread, boolean);
00080 
00081 extern boolean threadiswaiting (void);
00082 
00083 extern boolean threadyield (boolean);
00084 
00085 extern long grabthreadglobals (void);
00086 
00087 extern long releasethreadglobals (void);
00088 
00089 extern long grabthreadglobalsnopriority (void);
00090 
00091 extern long releasethreadglobalsnopriority (void);
00092 
00093 extern boolean initthreads (void);
00094 
00095 #ifdef fldebug
00096     extern void checkthreadglobals (void);
00097 #else
00098     #define checkthreadglobals() ((void *)0)
00099 #endif
00100 
00101 
00102 #endif

Generated on Wed May 31 18:20:03 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6