2004-09-28 16:34:51 +08:00
|
|
|
|
|
|
|
/*
|
2004-09-30 00:00:49 +08:00
|
|
|
* Copyright (C) Igor Sysoev
|
2012-01-18 23:07:43 +08:00
|
|
|
* Copyright (C) Nginx, Inc.
|
2004-09-28 16:34:51 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2003-11-05 01:09:19 +08:00
|
|
|
#ifndef _NGX_HTTP_BUSY_LOCK_H_INCLUDED_
|
|
|
|
#define _NGX_HTTP_BUSY_LOCK_H_INCLUDED_
|
|
|
|
|
|
|
|
|
|
|
|
#include <ngx_config.h>
|
|
|
|
#include <ngx_core.h>
|
2003-11-10 04:03:38 +08:00
|
|
|
#include <ngx_event.h>
|
2003-11-05 01:09:19 +08:00
|
|
|
#include <ngx_http.h>
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
2004-03-01 05:03:02 +08:00
|
|
|
u_char *md5_mask;
|
|
|
|
char *md5;
|
2007-10-15 02:56:15 +08:00
|
|
|
int cacheable;
|
2003-11-05 01:09:19 +08:00
|
|
|
|
2004-03-01 05:03:02 +08:00
|
|
|
int busy;
|
|
|
|
int max_busy;
|
2003-11-05 01:09:19 +08:00
|
|
|
|
2004-03-01 05:03:02 +08:00
|
|
|
int waiting;
|
|
|
|
int max_waiting;
|
2003-11-05 01:09:19 +08:00
|
|
|
|
2004-03-01 05:03:02 +08:00
|
|
|
time_t timeout;
|
2003-11-05 01:09:19 +08:00
|
|
|
|
2004-03-01 05:03:02 +08:00
|
|
|
ngx_event_mutex_t *mutex;
|
2003-11-05 01:09:19 +08:00
|
|
|
} ngx_http_busy_lock_t;
|
|
|
|
|
|
|
|
|
2003-11-10 04:03:38 +08:00
|
|
|
typedef struct {
|
|
|
|
time_t time;
|
|
|
|
ngx_event_t *event;
|
|
|
|
void (*event_handler)(ngx_event_t *ev);
|
|
|
|
u_char *md5;
|
|
|
|
int slot;
|
|
|
|
} ngx_http_busy_lock_ctx_t;
|
|
|
|
|
|
|
|
|
|
|
|
int ngx_http_busy_lock(ngx_http_busy_lock_t *bl, ngx_http_busy_lock_ctx_t *bc);
|
2007-10-15 02:56:15 +08:00
|
|
|
int ngx_http_busy_lock_cacheable(ngx_http_busy_lock_t *bl,
|
|
|
|
ngx_http_busy_lock_ctx_t *bc, int lock);
|
2003-11-11 05:09:22 +08:00
|
|
|
void ngx_http_busy_unlock(ngx_http_busy_lock_t *bl,
|
|
|
|
ngx_http_busy_lock_ctx_t *bc);
|
2003-11-10 04:03:38 +08:00
|
|
|
|
2003-11-05 06:12:39 +08:00
|
|
|
char *ngx_http_set_busy_lock_slot(ngx_conf_t *cf, ngx_command_t *cmd,
|
|
|
|
void *conf);
|
|
|
|
|
|
|
|
|
2003-11-05 01:09:19 +08:00
|
|
|
#endif /* _NGX_HTTP_BUSY_LOCK_H_INCLUDED_ */
|