remove debug codes
parent
b3a1fef3bc
commit
83a6027043
|
|
@ -74,7 +74,7 @@ static void sigSegvHandler(int signum, siginfo_t *info, void *ptr);
|
|||
static void sigDumpHandler(int sig);
|
||||
#endif
|
||||
|
||||
#define SCHEDULE_ENTRIES_COUNT 15
|
||||
#define SCHEDULE_ENTRIES_COUNT 5
|
||||
|
||||
static void usage(const char *program)
|
||||
{
|
||||
|
|
@ -82,24 +82,6 @@ static void usage(const char *program)
|
|||
program);
|
||||
}
|
||||
|
||||
static int counter = 0;
|
||||
static int test_delay(void *args)
|
||||
{
|
||||
logInfo("free arg: %p, count: %d", args, --counter);
|
||||
free(args);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int test_malloc(void *args)
|
||||
{
|
||||
int delay;
|
||||
args = malloc(1024);
|
||||
delay = (30L * rand()) / RAND_MAX;
|
||||
logInfo("malloc arg: %p, delay: %d, count: %d", args, delay, ++counter);
|
||||
sched_add_delay_task(test_delay, args, delay, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
char *conf_filename;
|
||||
|
|
@ -368,35 +350,6 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
//sched_set_delay_params(0, 0);
|
||||
sched_enable_delay_task();
|
||||
|
||||
srand(time(NULL));
|
||||
INIT_SCHEDULE_ENTRY(scheduleEntries[scheduleArray.count],
|
||||
scheduleArray.count + 1, TIME_NONE, TIME_NONE, TIME_NONE,
|
||||
1, test_malloc, NULL);
|
||||
scheduleArray.count++;
|
||||
|
||||
INIT_SCHEDULE_ENTRY(scheduleEntries[scheduleArray.count],
|
||||
scheduleArray.count + 1, TIME_NONE, TIME_NONE, TIME_NONE,
|
||||
1, test_malloc, NULL);
|
||||
scheduleArray.count++;
|
||||
|
||||
INIT_SCHEDULE_ENTRY(scheduleEntries[scheduleArray.count],
|
||||
scheduleArray.count + 1, TIME_NONE, TIME_NONE, TIME_NONE,
|
||||
2, test_malloc, NULL);
|
||||
scheduleArray.count++;
|
||||
|
||||
INIT_SCHEDULE_ENTRY(scheduleEntries[scheduleArray.count],
|
||||
scheduleArray.count + 1, TIME_NONE, TIME_NONE, TIME_NONE,
|
||||
5, test_malloc, NULL);
|
||||
scheduleArray.count++;
|
||||
|
||||
INIT_SCHEDULE_ENTRY(scheduleEntries[scheduleArray.count],
|
||||
scheduleArray.count + 1, TIME_NONE, TIME_NONE, TIME_NONE,
|
||||
10, test_malloc, NULL);
|
||||
scheduleArray.count++;
|
||||
|
||||
if ((result=sched_start(&scheduleArray, &schedule_tid, \
|
||||
g_thread_stack_size, (bool * volatile)&g_continue_flag)) != 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue