Couple of fixes in ioqueue_epoll for ticket #622 (still not working)
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2300 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
parent
b51845f64c
commit
9489e7a098
10516
aconfigure
10516
aconfigure
File diff suppressed because it is too large
Load Diff
|
@ -329,7 +329,7 @@ AC_SUBST(ac_os_objs)
|
|||
AC_MSG_CHECKING([ioqueue backend])
|
||||
AC_ARG_ENABLE(epoll,
|
||||
AC_HELP_STRING([--enable-epoll],
|
||||
[Use /dev/epoll ioqueue on Linux (beta)]),
|
||||
[Use /dev/epoll ioqueue on Linux (experimental)]),
|
||||
[
|
||||
ac_os_objs=ioqueue_epoll.o
|
||||
AC_MSG_RESULT([/dev/epoll])
|
||||
|
|
|
@ -253,6 +253,7 @@ PJ_DEF(pj_status_t) pj_ioqueue_create( pj_pool_t *pool,
|
|||
/* Init key list */
|
||||
pj_list_init(&ioqueue->free_list);
|
||||
pj_list_init(&ioqueue->closing_list);
|
||||
pj_list_init(&ioqueue->active_list);
|
||||
|
||||
|
||||
/* Pre-create all keys according to max_fd */
|
||||
|
@ -491,6 +492,14 @@ PJ_DEF(pj_status_t) pj_ioqueue_unregister( pj_ioqueue_key_t *key)
|
|||
PJ_ASSERT_RETURN(key != NULL, PJ_EINVAL);
|
||||
|
||||
ioqueue = key->ioqueue;
|
||||
|
||||
/* Lock the key to make sure no callback is simultaneously modifying
|
||||
* the key. We need to lock the key before ioqueue here to prevent
|
||||
* deadlock.
|
||||
*/
|
||||
pj_mutex_lock(key->mutex);
|
||||
|
||||
/* Also lock ioqueue */
|
||||
pj_lock_acquire(ioqueue->lock);
|
||||
|
||||
pj_assert(ioqueue->count > 0);
|
||||
|
|
Loading…
Reference in New Issue