a little bug in ngx_event_expire_timers

Ruslan Ermilov ru at nginx.com
Fri Jul 20 06:07:26 UTC 2012


On Fri, Jul 20, 2012 at 12:11:51PM +0800, Joy zhou wrote:
>    hi everyone:
>      
>      I have found a little bug at method ngx_event_expire_timers  of  the
>    file "src/event/ngx_event_timer.c "
>      
>      
>         84     for ( ;; ) {
>         85
>         86         ngx_mutex_lock(ngx_event_timer_mutex);
>         87
>         88         root = ngx_event_timer_rbtree.root;
>         89
>         90         if (root == sentinel) {
>         91             return;
>         92         }
>        
>                   [...]
>                }
>                
>       The above code should add 
>    "ngx_mutex_unlock(ngx_event_timer_mutex);" at 90 line,
>       Because the ngx_event_timer_mutex has locked at begin , but returned
>    without unlock , is it right?       

Only theoretically.  Practically, ngx_mutex_lock() is a no-op in nginx.



More information about the nginx-devel mailing list