mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-06 01:45:11 +00:00
Merge of timedwrlock detection broke build.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@190419 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1047,12 +1047,12 @@ static inline int _ast_rwlock_timedrdlock(ast_rwlock_t *lock, const char *name,
|
|||||||
|
|
||||||
ast_store_lock_info(AST_RDLOCK, file, line, func, name, lock);
|
ast_store_lock_info(AST_RDLOCK, file, line, func, name, lock);
|
||||||
#ifdef HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK
|
#ifdef HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK
|
||||||
res = pthread_rwlock_timedrdlock(&t->lock, abs_timeout);
|
res = pthread_rwlock_timedrdlock(lock, abs_timeout);
|
||||||
#else
|
#else
|
||||||
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);
|
||||||
@@ -1093,12 +1093,12 @@ static inline int _ast_rwlock_timedwrlock(ast_rwlock_t *lock, const char *name,
|
|||||||
|
|
||||||
ast_store_lock_info(AST_WRLOCK, file, line, func, name, lock);
|
ast_store_lock_info(AST_WRLOCK, file, line, func, name, lock);
|
||||||
#ifdef HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK
|
#ifdef HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK
|
||||||
res = pthread_rwlock_timedwrlock(&t->lock, abs_timeout);
|
res = pthread_rwlock_timedwrlock(lock, abs_timeout);
|
||||||
#else
|
#else
|
||||||
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user