aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-20 17:15:54 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-20 17:15:54 +0000
commitc15c0120f1da9354dbfffd80d43f83c3ef372732 (patch)
treed1049b4c6e02a7236e3a64c09f10633b99decc64 /tests
parentef5097f7805184a21929702dd7e28cfce9dc3261 (diff)
Some scheduler API cleanup and improvements.
Previously, I had added the ast_sched_thread stuff that was a generic scheduler thread implementation. However, if you used it, it required using different functions for modifying scheduler contents. This patch reworks how this is done and just allows you to optionally start a thread on the original scheduler context structure that has always been there. This makes it trivial to switch to the generic scheduler thread implementation without having to touch any of the other code that adds or removes scheduler entries. In passing, I made some naming tweaks to add ast_ prefixes where they were not there before. Review: https://reviewboard.asterisk.org/r/1007/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@299091 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'tests')
-rw-r--r--tests/test_sched.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_sched.c b/tests/test_sched.c
index 1090e5b48..0062afb09 100644
--- a/tests/test_sched.c
+++ b/tests/test_sched.c
@@ -46,7 +46,7 @@ static int sched_cb(const void *data)
AST_TEST_DEFINE(sched_test_order)
{
- struct sched_context *con;
+ struct ast_sched_context *con;
enum ast_test_result_state res = AST_TEST_FAIL;
int id1, id2, id3, wait;
@@ -63,7 +63,7 @@ AST_TEST_DEFINE(sched_test_order)
break;
}
- if (!(con = sched_context_create())) {
+ if (!(con = ast_sched_context_create())) {
ast_test_status_update(test,
"Test failed - could not create scheduler context\n");
return AST_TEST_FAIL;
@@ -154,14 +154,14 @@ AST_TEST_DEFINE(sched_test_order)
res = AST_TEST_PASS;
return_cleanup:
- sched_context_destroy(con);
+ ast_sched_context_destroy(con);
return res;
}
static char *handle_cli_sched_bench(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
- struct sched_context *con;
+ struct ast_sched_context *con;
struct timeval start;
unsigned int num, i;
int *sched_ids = NULL;
@@ -185,7 +185,7 @@ static char *handle_cli_sched_bench(struct ast_cli_entry *e, int cmd, struct ast
return CLI_SHOWUSAGE;
}
- if (!(con = sched_context_create())) {
+ if (!(con = ast_sched_context_create())) {
ast_cli(a->fd, "Test failed - could not create scheduler context\n");
return CLI_FAILURE;
}
@@ -225,7 +225,7 @@ static char *handle_cli_sched_bench(struct ast_cli_entry *e, int cmd, struct ast
ast_cli(a->fd, "Test complete - %" PRIi64 " us\n", ast_tvdiff_us(ast_tvnow(), start));
return_cleanup:
- sched_context_destroy(con);
+ ast_sched_context_destroy(con);
if (sched_ids) {
ast_free(sched_ids);
}