00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
00018
00024 #if !defined(GLOBUS_I_THREAD_H)
00025 #define GLOBUS_I_THREAD_H 1
00026
00027
00028
00029
00030 #include "globus_common_include.h"
00031
00032 #define GLOBUS_L_LIBC_MAX_ERR_SIZE 512
00033
00034 #define GlobusThreadMalloc(Func, Var, Type, Size) \
00035 { \
00036 if ((Size) > 0) \
00037 { \
00038 if (((Var) = (Type) globus_malloc (Size)) == (Type) NULL) \
00039 { \
00040 globus_fatal(\
00041 "%s: malloc of size %d failed for %s %s in file %s line %d\n",\
00042 #Func, (Size), #Type, #Var, __FILE__, __LINE__); \
00043 } \
00044 } \
00045 else \
00046 { \
00047 (Var) = (Type) NULL; \
00048 } \
00049 }
00050
00051 #define GlobusThreadFree(Ptr) \
00052 { \
00053 if ((Ptr) != NULL) \
00054 { \
00055 globus_macro_free(Ptr); \
00056 } \
00057 }
00058
00059 #ifdef __cplusplus
00060 extern "C" {
00061 #endif
00062
00063
00064
00065
00066 void
00067 globus_i_thread_report_bad_rc(int rc,
00068 char *message );
00069
00070 #define globus_i_thread_test_rc( a, b ) \
00071 do \
00072 { \
00073 if( a != GLOBUS_SUCCESS && a != EINTR ) \
00074 { \
00075 globus_i_thread_report_bad_rc( a, b ); \
00076 } \
00077 else \
00078 { \
00079 a = GLOBUS_SUCCESS;; \
00080 } \
00081 } while(0)
00082
00083 int globus_i_thread_ignore_sigpipe(void);
00084
00085 #define MAX_ERR_SIZE 80
00086 #define GLOBUS_I_THREAD_GRAN 256
00087 #define GLOBUS_I_THREAD_USER_THREAD 0
00088
00089 #ifndef GLOBUS_THREAD_DEFAULT_STACK_SIZE
00090 #define GLOBUS_THREAD_DEFAULT_STACK_SIZE 0
00091 #endif
00092
00093 #ifdef __cplusplus
00094 }
00095 #endif
00096
00097 #endif
00098
00099 #endif