win-pvdrivers

view liblfds.6/src/single_dir_for_windows_kernel/stack_internal.h @ 1106:2d392ecdd366

Fix race is xenvbd causing 30 second freeze under high load
author James Harper <james.harper@bendigoit.com.au>
date Tue Nov 11 23:08:11 2014 +1100 (2014-11-11)
parents 6300617040e0
children
line source
1 /***** the library wide include file *****/
2 #include "liblfds_internal.h"
4 /***** pragmas *****/
6 /***** defines *****/
7 #define STACK_POINTER 0
8 #define STACK_COUNTER 1
9 #define STACK_PAC_SIZE 2
11 /***** structures *****/
12 #pragma pack( push, ALIGN_DOUBLE_POINTER )
14 struct stack_state
15 {
16 // TRD : must come first for alignment
17 struct stack_element
18 *volatile top[STACK_PAC_SIZE];
20 atom_t
21 aba_counter;
23 struct freelist_state
24 *fs;
25 };
27 struct stack_element
28 {
29 struct stack_element
30 *next[STACK_PAC_SIZE];
32 struct freelist_element
33 *fe;
35 void
36 *user_data;
37 };
39 #pragma pack( pop )
41 /***** private prototypes *****/
42 int stack_internal_freelist_init_function( void **user_data, void *user_state );
43 void stack_internal_freelist_delete_function( void *user_data, void *user_state );
45 void stack_internal_new_element_from_freelist( struct stack_state *ss, struct stack_element *se[STACK_PAC_SIZE], void *user_data );
46 void stack_internal_new_element( struct stack_state *ss, struct stack_element *se[STACK_PAC_SIZE], void *user_data );
47 void stack_internal_init_element( struct stack_state *ss, struct stack_element *se[STACK_PAC_SIZE], struct freelist_element *fe, void *user_data );
49 void stack_internal_push( struct stack_state *ss, struct stack_element *se[STACK_PAC_SIZE] );