Remove unthreaded support

This commit is contained in:
Witold Kręcicki
2018-06-06 11:39:50 +02:00
parent 8e164f784d
commit 5cdb38c2c7
45 changed files with 596 additions and 1872 deletions

View File

@@ -40,9 +40,7 @@ int counter = 0;
static int active[10];
static bool done = false;
#ifdef ISC_PLATFORM_USETHREADS
static isc_condition_t cv;
#endif
static void
set(isc_task_t *task, isc_event_t *event) {
@@ -138,10 +136,6 @@ ATF_TC_BODY(all_events, tc) {
isc_task_send(task, &event);
while ((a == 0 || b == 0) && i++ < 5000) {
#ifndef ISC_PLATFORM_USETHREADS
while (isc__taskmgr_ready(taskmgr))
isc__taskmgr_dispatch(taskmgr);
#endif
isc_test_nap(1000);
}
@@ -175,13 +169,11 @@ ATF_TC_BODY(privileged_events, tc) {
result = isc_test_begin(NULL, true, 0);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
#ifdef ISC_PLATFORM_USETHREADS
/*
* Pause the task manager so we can fill up the work queue
* without things happening while we do it.
*/
isc__taskmgr_pause(taskmgr);
#endif
result = isc_task_create(taskmgr, 0, &task1);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
@@ -239,16 +231,10 @@ ATF_TC_BODY(privileged_events, tc) {
isc_taskmgr_setmode(taskmgr, isc_taskmgrmode_privileged);
ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_privileged);
#ifdef ISC_PLATFORM_USETHREADS
isc__taskmgr_resume(taskmgr);
#endif
/* We're waiting for *all* variables to be set */
while ((a == 0 || b == 0 || c == 0 || d == 0 || e == 0) && i++ < 5000) {
#ifndef ISC_PLATFORM_USETHREADS
while (isc__taskmgr_ready(taskmgr))
isc__taskmgr_dispatch(taskmgr);
#endif
isc_test_nap(1000);
}
@@ -304,13 +290,11 @@ ATF_TC_BODY(privilege_drop, tc) {
result = isc_test_begin(NULL, true, 0);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
#ifdef ISC_PLATFORM_USETHREADS
/*
* Pause the task manager so we can fill up the work queue
* without things happening while we do it.
*/
isc__taskmgr_pause(taskmgr);
#endif
result = isc_task_create(taskmgr, 0, &task1);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
@@ -368,17 +352,11 @@ ATF_TC_BODY(privilege_drop, tc) {
isc_taskmgr_setmode(taskmgr, isc_taskmgrmode_privileged);
ATF_CHECK_EQ(isc_taskmgr_mode(taskmgr), isc_taskmgrmode_privileged);
#ifdef ISC_PLATFORM_USETHREADS
isc__taskmgr_resume(taskmgr);
#endif
/* We're waiting for all variables to be set. */
while ((a == -1 || b == -1 || c == -1 || d == -1 || e == -1) &&
i++ < 5000) {
#ifndef ISC_PLATFORM_USETHREADS
while (isc__taskmgr_ready(taskmgr))
isc__taskmgr_dispatch(taskmgr);
#endif
isc_test_nap(1000);
}
@@ -645,10 +623,6 @@ ATF_TC_BODY(task_exclusive, tc) {
isc_test_end();
}
/*
* The remainder of these tests require threads
*/
#ifdef ISC_PLATFORM_USETHREADS
/*
* Max tasks test:
* The task system can create and execute many tasks. Tests with 10000.
@@ -1446,7 +1420,6 @@ ATF_TC_HEAD(purgeevent_notpurge, tc) {
ATF_TC_BODY(purgeevent_notpurge, tc) {
try_purgeevent(false);
}
#endif
/*
* Main
@@ -1458,8 +1431,6 @@ ATF_TP_ADD_TCS(tp) {
ATF_TP_ADD_TC(tp, privilege_drop);
ATF_TP_ADD_TC(tp, basic);
ATF_TP_ADD_TC(tp, task_exclusive);
#ifdef ISC_PLATFORM_USETHREADS
ATF_TP_ADD_TC(tp, manytasks);
ATF_TP_ADD_TC(tp, shutdown);
ATF_TP_ADD_TC(tp, post_shutdown);
@@ -1467,8 +1438,6 @@ ATF_TP_ADD_TCS(tp) {
ATF_TP_ADD_TC(tp, purgerange);
ATF_TP_ADD_TC(tp, purgeevent);
ATF_TP_ADD_TC(tp, purgeevent_notpurge);
#endif
return (atf_no_error());
}