diff options
author | Joshua Colp <jcolp@digium.com> | 2015-12-28 16:06:54 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2015-12-28 16:06:55 -0600 |
commit | 47d508e9115042d93bf5a7dab025bceecaabd2e1 (patch) | |
tree | 628e5cd51a4d9768ceca50f5d4753413d96306c7 /main | |
parent | e4a566918a4bcf01269f321f0979a7bf4c5c33d6 (diff) | |
parent | a2804007585aca2aa0100d12dfa3413efeb084a5 (diff) |
Merge "test_time: Provide a timeout when waiting." into 13
Diffstat (limited to 'main')
-rw-r--r-- | main/stdtime/localtime.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/main/stdtime/localtime.c b/main/stdtime/localtime.c index 4b005207e..702edbe85 100644 --- a/main/stdtime/localtime.c +++ b/main/stdtime/localtime.c @@ -796,13 +796,16 @@ static void sstate_free(struct state *p) void ast_localtime_wakeup_monitor(struct ast_test *info) { + struct timeval wait_now = ast_tvnow(); + struct timespec wait_time = { .tv_sec = wait_now.tv_sec + 2, .tv_nsec = wait_now.tv_usec * 1000 }; + if (inotify_thread != AST_PTHREADT_NULL) { AST_LIST_LOCK(&zonelist); #ifdef TEST_FRAMEWORK test = info; #endif pthread_kill(inotify_thread, SIGURG); - ast_cond_wait(&initialization, &(&zonelist)->lock); + ast_cond_timedwait(&initialization, &(&zonelist)->lock, &wait_time); #ifdef TEST_FRAMEWORK test = NULL; #endif |