mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-02 10:22:46 +00:00
make asterisk compile under devmode with DEBUG_THREADS enabled on OpenBSD
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@216435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1027,7 +1027,7 @@ static inline int _ast_rwlock_timedrdlock(ast_rwlock_t *lock, const char *name,
|
|||||||
do {
|
do {
|
||||||
struct timeval _start = ast_tvnow(), _diff;
|
struct timeval _start = ast_tvnow(), _diff;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (!(res = pthread_rwlock_tryrdlock(&t->lock))) {
|
if (!(res = pthread_rwlock_tryrdlock(lock))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
_diff = ast_tvsub(ast_tvnow(), _start);
|
_diff = ast_tvsub(ast_tvnow(), _start);
|
||||||
@@ -1076,7 +1076,7 @@ static inline int _ast_rwlock_timedwrlock(ast_rwlock_t *lock, const char *name,
|
|||||||
do {
|
do {
|
||||||
struct timeval _start = ast_tvnow(), _diff;
|
struct timeval _start = ast_tvnow(), _diff;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (!(res = pthread_rwlock_trywrlock(&t->lock))) {
|
if (!(res = pthread_rwlock_trywrlock(lock))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
_diff = ast_tvsub(ast_tvnow(), _start);
|
_diff = ast_tvsub(ast_tvnow(), _start);
|
||||||
|
@@ -726,7 +726,7 @@ static int handle_show_locks(int fd, int argc, char *argv[])
|
|||||||
AST_LIST_TRAVERSE(&lock_infos, lock_info, entry) {
|
AST_LIST_TRAVERSE(&lock_infos, lock_info, entry) {
|
||||||
int i;
|
int i;
|
||||||
if (lock_info->num_locks) {
|
if (lock_info->num_locks) {
|
||||||
ast_dynamic_str_append(&str, 0, "=== Thread ID: %u (%s)\n", (int) lock_info->thread_id,
|
ast_dynamic_str_append(&str, 0, "=== Thread ID: %ld (%s)\n", (long) lock_info->thread_id,
|
||||||
lock_info->thread_name);
|
lock_info->thread_name);
|
||||||
pthread_mutex_lock(&lock_info->lock);
|
pthread_mutex_lock(&lock_info->lock);
|
||||||
for (i = 0; str && i < lock_info->num_locks; i++) {
|
for (i = 0; str && i < lock_info->num_locks; i++) {
|
||||||
|
Reference in New Issue
Block a user