shutdown_test.c revision c90f5e8d1edbd5c277f2ee320167a12a30ba7c7b
/*
* Copyright (C) 1998, 1999, 2000 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <isc/assertions.h>
#include <isc/condition.h>
#include <isc/eventclass.h>
typedef struct {
isc_task_t * task;
isc_timer_t * timer;
unsigned int ticks;
char name[16];
isc_task_t * peer;
} t_info;
#define MAX_TASKS 3
static unsigned int task_count;
static isc_taskmgr_t * task_manager;
static isc_timermgr_t * timer_manager;
static void
}
static void
}
static void
sizeof *event);
}
}
static void
}
static void
{
t1_shutdown, &tasks[0],
sizeof *event);
}
sizeof *event);
}
}
static t_info *
} else
task_count++;
return (ti);
}
int
unsigned int workers;
if (argc > 1)
else
workers = 2;
/*
* Test run-triggered shutdown.
*/
/*
* Test implicit shutdown.
*/
/*
* Test anti-zombie code.
*/
printf("Statistics for mctx:\n");
printf("Statistics for mctx2:\n");
return (0);
}