cleanup: ck_cohort validation test

Removed unnecessary includes and fixed shadowed variable warning.
ck_pring
Brendon Scheinman 12 years ago
parent 0a826ca93b
commit d5c05309b4

@ -26,15 +26,9 @@
*/ */
#include <errno.h> #include <errno.h>
#include <inttypes.h>
#include <pthread.h> #include <pthread.h>
#include <math.h>
#include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <strings.h>
#include <unistd.h>
#include <sys/time.h>
#include <ck_pr.h> #include <ck_pr.h>
#include <ck_cohort.h> #include <ck_cohort.h>
@ -49,7 +43,7 @@
static struct affinity a; static struct affinity a;
static unsigned int locked; static unsigned int locked;
static int nthr; static int nthr;
static ck_spinlock_fas_t global_lock = CK_SPINLOCK_FAS_INITIALIZER; static ck_spinlock_fas_t global_fas_lock = CK_SPINLOCK_FAS_INITIALIZER;
typedef ck_spinlock_fas_t ck_spinlock_fas; typedef ck_spinlock_fas_t ck_spinlock_fas;
CK_CREATE_COHORT(fas_fas, ck_spinlock_fas, ck_spinlock_fas) CK_CREATE_COHORT(fas_fas, ck_spinlock_fas, ck_spinlock_fas)
static struct ck_cohort_fas_fas *cohorts; static struct ck_cohort_fas_fas *cohorts;
@ -147,7 +141,7 @@ main(int argc, char *argv[])
cohorts = malloc(sizeof(struct ck_cohort_fas_fas) * n_cohorts); cohorts = malloc(sizeof(struct ck_cohort_fas_fas) * n_cohorts);
for (i = 0 ; i < n_cohorts ; i++) { for (i = 0 ; i < n_cohorts ; i++) {
local_lock = malloc(sizeof(ck_spinlock_fas_t)); local_lock = malloc(sizeof(ck_spinlock_fas_t));
ck_cohort_fas_fas_init(cohorts + i, &global_lock, local_lock); ck_cohort_fas_fas_init(cohorts + i, &global_fas_lock, local_lock);
} }
fprintf(stderr, "done\n"); fprintf(stderr, "done\n");

Loading…
Cancel
Save