mtx 15 core/ngx_shmtx.c ngx_shmtx_create(ngx_shmtx_t *mtx, void *addr, u_char *name) mtx 17 core/ngx_shmtx.c mtx->lock = addr; mtx 26 core/ngx_shmtx.c ngx_shmtx_create(ngx_shmtx_t *mtx, void *addr, u_char *name) mtx 28 core/ngx_shmtx.c if (mtx->name) { mtx 30 core/ngx_shmtx.c if (ngx_strcmp(name, mtx->name) == 0) { mtx 31 core/ngx_shmtx.c mtx->name = name; mtx 35 core/ngx_shmtx.c ngx_shmtx_destory(mtx); mtx 38 core/ngx_shmtx.c mtx->fd = ngx_open_file(name, NGX_FILE_RDWR, NGX_FILE_CREATE_OR_OPEN, mtx 41 core/ngx_shmtx.c if (mtx->fd == NGX_INVALID_FILE) { mtx 52 core/ngx_shmtx.c mtx->name = name; mtx 59 core/ngx_shmtx.c ngx_shmtx_destory(ngx_shmtx_t *mtx) mtx 61 core/ngx_shmtx.c if (ngx_close_file(mtx->fd) == NGX_FILE_ERROR) { mtx 63 core/ngx_shmtx.c ngx_close_file_n " \"%s\" failed", mtx->name); mtx 25 core/ngx_shmtx.h ngx_int_t ngx_shmtx_create(ngx_shmtx_t *mtx, void *addr, u_char *name); mtx 31 core/ngx_shmtx.h ngx_shmtx_trylock(ngx_shmtx_t *mtx) mtx 33 core/ngx_shmtx.h return (*mtx->lock == 0 && ngx_atomic_cmp_set(mtx->lock, 0, ngx_pid)); mtx 36 core/ngx_shmtx.h #define ngx_shmtx_lock(mtx) ngx_spinlock((mtx)->lock, ngx_pid, 1024) mtx 38 core/ngx_shmtx.h #define ngx_shmtx_unlock(mtx) (void) ngx_atomic_cmp_set((mtx)->lock, ngx_pid, 0) mtx 40 core/ngx_shmtx.h #define ngx_shmtx_destory(mtx) mtx 46 core/ngx_shmtx.h ngx_shmtx_trylock(ngx_shmtx_t *mtx) mtx 50 core/ngx_shmtx.h err = ngx_trylock_fd(mtx->fd); mtx 68 core/ngx_shmtx.h ngx_log_abort(err, ngx_trylock_fd_n " %s failed", mtx->name); mtx 75 core/ngx_shmtx.h ngx_shmtx_lock(ngx_shmtx_t *mtx) mtx 79 core/ngx_shmtx.h err = ngx_lock_fd(mtx->fd); mtx 85 core/ngx_shmtx.h ngx_log_abort(err, ngx_lock_fd_n " %s failed", mtx->name); mtx 90 core/ngx_shmtx.h ngx_shmtx_unlock(ngx_shmtx_t *mtx) mtx 94 core/ngx_shmtx.h err = ngx_unlock_fd(mtx->fd); mtx 100 core/ngx_shmtx.h ngx_log_abort(err, ngx_unlock_fd_n " %s failed", mtx->name); mtx 104 core/ngx_shmtx.h void ngx_shmtx_destory(ngx_shmtx_t *mtx);