regressions: Fix for alarm interface.

ck_pring
David Joseph 12 years ago
parent d7c528694d
commit da23134615

@ -70,7 +70,7 @@ struct ht_epoch {
ck_epoch_entry_t epoch_entry;
};
COMMON_ALARM_DECLARE_GLOBAL(alarm_event, next_stage)
COMMON_ALARM_DECLARE_GLOBAL(ht_alarm, alarm_event, next_stage)
static void
alarm_handler(int s)
@ -269,7 +269,7 @@ main(int argc, char *argv[])
pthread_t *readers;
double p_r, p_d;
COMMON_ALARM_DECLARE_LOCAL(alarm_event)
COMMON_ALARM_DECLARE_LOCAL(ht_alarm, alarm_event)
r = 20;
s = 8;
@ -309,7 +309,7 @@ main(int argc, char *argv[])
}
}
COMMON_ALARM_INIT(alarm_event, r)
COMMON_ALARM_INIT(ht_alarm, alarm_event, r)
affinerator.delta = 1;
readers = malloc(sizeof(pthread_t) * n_threads);

@ -151,7 +151,7 @@ common_alarm(void (*sig_handler)(int), void *alarm_event, unsigned int duration)
#endif
#define COMMON_ALARM_DECLARE_GLOBAL(prefix, alarm_event_name, flag_name) \
static HANDLE prefix##_common_win_alarm_timer; \
static HANDLE prefix##_alarm_event_name; \
static HANDLE alarm_event_name; \
static LARGE_INTEGER prefix##_common_alarm_timer_length; \
\
static void CALLBACK \
@ -190,8 +190,8 @@ prefix##_common_win_alarm(void *unused) \
prefix##_common_alarm_tl = -1 * (duration) * SECOND_TIMER; \
prefix##_common_alarm_timer_length.LowPart = (DWORD) (tl & 0xFFFFFFFF); \
prefix##_common_alarm_timer_length.HighPart = (LONG) (tl >> 32); \
prefix##_alarm_event_name = CreateEvent(NULL, false, false, NULL); \
assert(prefix##_alarm_event_name != NULL); \
alarm_event_name = CreateEvent(NULL, false, false, NULL); \
assert(alarm_event_name != NULL); \
prefix##_common_win_alarm_timer = CreateWaitableTimer(NULL, true, NULL); \
assert(prefix##_common_win_alarm_timer != NULL); \
if (pthread_create(&prefix##_common_win_alarm_thread, \
@ -202,7 +202,7 @@ prefix##_common_win_alarm(void *unused) \
#else
#define COMMON_ALARM_DECLARE_GLOBAL(prefix, alarm_event_name, flag_name)
#define COMMON_ALARM_DECLARE_LOCAL(prefix, alarm_event_name) \
int prefix##_alarm_event_name = 0;
int alarm_event_name = 0;
#define COMMON_ALARM_INIT(prefix, alarm_event_name, duration)
#endif

Loading…
Cancel
Save