#include #include #include #include static void * func (void *p) { int *counter = (int *) p; unsigned i; for (i=0; i<100; i++) { (*counter) ++; { int array[17]; unsigned x = i % (sizeof(array)/sizeof(array[0])); /* VRP could prove that x is within [0,16], but until then, the following access will ensure that array[] is registered to libmudflap. */ array[x] = i; } sched_yield (); /* sleep (1); */ } return (NULL); } int main () { int rc; unsigned i; enum foo { NT=10 }; pthread_t threads[NT]; int counts[NT]; for (i=0; i