![]() |
Helixis 1.0
Task Programming API
|
00001 /***** the library wide include file *****/ 00002 #include "liblfds/liblfds_internal.h" 00003 00004 #if defined(HLX_BUILD_WITH_PARALLEL_THREADING) 00005 00006 /***** defines *****/ 00007 #define FREELIST_POINTER 0 00008 #define FREELIST_COUNTER 1 00009 #define FREELIST_PAC_SIZE 2 00010 00011 /***** structures *****/ 00012 #pragma pack( push, ALIGN_DOUBLE_POINTER ) 00013 00014 struct freelist_state 00015 { 00016 struct freelist_element 00017 *volatile top[FREELIST_PAC_SIZE]; 00018 00019 int 00020 (*user_data_init_function)( void **user_data, void *user_state ); 00021 00022 void 00023 *user_state; 00024 00025 atom_t 00026 aba_counter, 00027 element_count; 00028 }; 00029 00030 struct freelist_element 00031 { 00032 struct freelist_element 00033 *next[FREELIST_PAC_SIZE]; 00034 00035 void 00036 *user_data; 00037 }; 00038 00039 #pragma pack( pop ) 00040 00041 /***** private prototypes *****/ 00042 atom_t freelist_internal_new_element( struct freelist_state *fs, struct freelist_element **fe ); 00043 void freelist_internal_validate( struct freelist_state *fs, struct validation_info *vi, enum data_structure_validity *freelist_validity ); 00044 00045 #endif