﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
138	Does ngx_mutex_init have an error?	Vincent Lee	somebody	".\nginx\src\os\win32\ngx_thread.c
#if (NGX_THREADS)
ngx_mutex_t  *ngx_event_timer_mutex;// this ngx_event_timer_mutex is a pointer.
#endif

ngx_mutex_t *
ngx_mutex_init(ngx_log_t *log, ngx_uint_t flags)
{
    return (ngx_mutex_t *) 1;//convert 1 to ""ngx_mutex_t *"" ???
}

ngx_int_t
ngx_event_timer_init(ngx_log_t *log)
{
    ngx_rbtree_init(&ngx_event_timer_rbtree, &ngx_event_timer_sentinel,
                    ngx_rbtree_insert_timer_value);
#if (NGX_THREADS)

    if (ngx_event_timer_mutex) { //ngx_event_timer_mutex is 1
        ngx_event_timer_mutex->log = log;//here will be error...
        return NGX_OK;
    }

    ngx_event_timer_mutex = ngx_mutex_init(log, 0);
    if (ngx_event_timer_mutex == NULL) {
        return NGX_ERROR;
    }
#endif
    return NGX_OK;
}

as you see, ngx_mutex_init converts 1 to a ""ngx_mutex_t *"" pointer, and if we do ""ngx_event_timer_mutex->log = log;"", it will tigger errors."	defect	closed	minor		other	1.1.x	fixed	ngx_mutex_init	win32	win32	nginx version: nginx/1.1.16
