Mercurial > hg > nginx
diff src/core/ngx_shmtx.c @ 860:201d017ea470
slab allocator in shared memory
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 20 Nov 2006 08:51:45 +0000 |
parents | 3f8a2132b93d |
children | 01884449985f |
line wrap: on
line diff
--- a/src/core/ngx_shmtx.c +++ b/src/core/ngx_shmtx.c @@ -12,7 +12,7 @@ ngx_int_t -ngx_shmtx_create(ngx_shmtx_t *mtx, void *addr, u_char *name, ngx_log_t *log) +ngx_shmtx_create(ngx_shmtx_t *mtx, void *addr, u_char *name) { mtx->lock = addr; @@ -23,14 +23,12 @@ ngx_shmtx_create(ngx_shmtx_t *mtx, void ngx_int_t -ngx_shmtx_create(ngx_shmtx_t *mtx, void *addr, u_char *name, ngx_log_t *log) +ngx_shmtx_create(ngx_shmtx_t *mtx, void *addr, u_char *name) { if (mtx->name) { if (ngx_strcmp(name, mtx->name) == 0) { mtx->name = name; - mtx->log = log; - return NGX_OK; } @@ -40,18 +38,17 @@ ngx_shmtx_create(ngx_shmtx_t *mtx, void mtx->fd = ngx_open_file(name, NGX_FILE_RDWR, NGX_FILE_CREATE_OR_OPEN); if (mtx->fd == NGX_INVALID_FILE) { - ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, + ngx_log_error(NGX_LOG_EMERG, ngx_cycle->log, ngx_errno, ngx_open_file_n " \"%s\" failed", name); return NGX_ERROR; } if (ngx_delete_file(name) == NGX_FILE_ERROR) { - ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, + ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_errno, ngx_delete_file_n " \"%s\" failed", name); } mtx->name = name; - mtx->log = log; return NGX_OK; } @@ -61,7 +58,7 @@ void ngx_shmtx_destory(ngx_shmtx_t *mtx) { if (ngx_close_file(mtx->fd) == NGX_FILE_ERROR) { - ngx_log_error(NGX_LOG_ALERT, mtx->log, ngx_errno, + ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, ngx_errno, ngx_close_file_n " \"%s\" failed", mtx->name); } }