summaryrefslogtreecommitdiff
path: root/tests/test_sched.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2010-12-20 17:15:54 +0000
committerRussell Bryant <russell@russellbryant.com>2010-12-20 17:15:54 +0000
commitcc0b7e7df540e5833c79c9b12ef880f03a74b922 (patch)
treed1049b4c6e02a7236e3a64c09f10633b99decc64 /tests/test_sched.c
parentcf655aa1c9acabad60dcd9febd952de136b9838d (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: https://origsvn.digium.com/svn/asterisk/trunk@299091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'tests/test_sched.c')
-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);
}