65 struct timeval start_time;
70 info->name =
"named_lock_test";
71 info->category =
"/main/lock/";
72 info->summary =
"Named Lock test";
74 "Tests that named locks operate as expected";
87 ast_test_validate_cleanup(
test, lock1 !=
NULL, res, fail);
90 ast_test_validate_cleanup(
test, lock2 !=
NULL, res, fail);
123 ast_test_validate_cleanup(
test, duration > 1500 && duration < 3500, res, fail);
132 pthread_join(thread1,
NULL);
133 pthread_join(thread2,
NULL);
Asterisk main include file. File version handling, generic pbx functions.
#define ast_named_lock_put(lock)
Put a named lock handle away.
#define ast_named_lock_get(lock_type, keyspace, key)
Geta named lock handle.
@ AST_NAMED_LOCK_TYPE_MUTEX
Asterisk locking-related definitions:
Asterisk module definitions.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
#define AST_TEST_REGISTER(cb)
#define ast_test_status_update(a, b, c...)
#define AST_TEST_UNREGISTER(cb)
static void * lock_thread(void *data)
AST_TEST_DEFINE(named_lock_test)
static int load_module(void)
static int unload_module(void)
int64_t ast_tvdiff_ms(struct timeval end, struct timeval start)
Computes the difference (in milliseconds) between two struct timeval instances.
struct timeval ast_tvnow(void)
Returns current timeval. Meant to replace calls to gettimeofday().
#define ast_pthread_create(a, b, c, d)