Home | History | Annotate | Download | only in helgrind

Lines Matching defs:Bar

2771    Bar;
2773 static Bar* new_Bar ( void ) {
2774 Bar* bar = HG_(zalloc)( "hg.nB.1 (new_Bar)", sizeof(Bar) );
2775 tl_assert(bar);
2777 tl_assert(bar->initted == False);
2778 return bar;
2781 static void delete_Bar ( Bar* bar ) {
2782 tl_assert(bar);
2783 if (bar->waiting)
2784 VG_(deleteXA)(bar->waiting);
2785 HG_(free)(bar);
2790 /* pthread_barrier_t* -> Bar* */
2801 static Bar* map_barrier_to_Bar_lookup_or_alloc ( void* barrier ) {
2806 return (Bar*)val;
2808 Bar* bar = new_Bar();
2809 VG_(addToFM)( map_barrier_to_Bar, (UWord)barrier, (UWord)bar );
2810 return bar;
2818 Bar* bar = (Bar*)valW;
2820 delete_Bar(bar);
2831 Bar* bar;
2853 bar = map_barrier_to_Bar_lookup_or_alloc(barrier);
2854 tl_assert(bar);
2856 if (bar->initted) {
2862 if (bar->waiting && VG_(sizeXA)(bar->waiting) > 0) {
2863 tl_assert(bar->initted);
2867 VG_(dropTailXA)(bar->waiting, VG_(sizeXA)(bar->waiting));
2869 if (!bar->waiting) {
2870 bar->waiting = VG_(newXA)( HG_(zalloc), "hg.eHPBIP.1", HG_(free),
2874 tl_assert(bar->waiting);
2875 tl_assert(VG_(sizeXA)(bar->waiting) == 0);
2876 bar->initted = True;
2877 bar
2878 bar->size = count;
2886 Bar* bar;
2899 bar = map_barrier_to_Bar_lookup_or_alloc(barrier);
2900 tl_assert(bar);
2902 if (!bar->initted) {
2908 if (bar->initted && bar->waiting && VG_(sizeXA)(bar->waiting) > 0) {
2932 static void do_barrier_cross_sync_and_empty ( Bar* bar )
2934 /* XXX check bar->waiting has no duplicates */
2938 tl_assert(bar->waiting);
2939 tl_assert(VG_(sizeXA)(bar->waiting) == bar->size);
2942 for (i = 0; i < bar->size; i++) {
2943 Thread* t = *(Thread**)VG_(indexXA)(bar->waiting, i);
2948 for (i = 0; i < bar->size; i++) {
2949 Thread* t = *(Thread**)VG_(indexXA)(bar->waiting, i);
2955 VG_(dropTailXA)(bar->waiting, VG_(sizeXA)(bar->waiting));
3007 Bar* bar;
3018 bar = map_barrier_to_Bar_lookup_or_alloc(barrier);
3019 tl_assert(bar);
3021 if (!bar->initted) {
3029 tl_assert(bar->size > 0);
3030 tl_assert(bar->waiting);
3032 VG_(addToXA)( bar->waiting, &thr );
3035 present = VG_(sizeXA)(bar->waiting);
3036 tl_assert(present > 0 && present <= bar->size);
3038 if (present < bar->size)
3041 do_barrier_cross_sync_and_empty(bar);
3050 Bar* bar;
3061 bar = map_barrier_to_Bar_lookup_or_alloc(barrier);
3062 tl_assert(bar);
3064 if (!bar->initted) {
3071 if (!bar->resizable) {
3086 tl_assert(bar->size > 0);
3087 tl_assert(bar->waiting);
3091 if (newcount >= bar->size) {
3095 bar->size = newcount;
3101 present = VG_(sizeXA)(bar->waiting);
3102 tl_assert(present >= 0 && present <= bar->size);
3104 bar->size = present; /* keep the cross_sync call happy */
3105 do_barrier_cross_sync_and_empty(bar);
3107 bar->size = newcount;