Ai
1 Star 0 Fork 2

jxva/ngx_thread

forked from laozi2/ngx_thread 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ngx_common.h 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
laozi2 提交于 2017-03-14 19:01 +08:00 . first commit
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
#ifndef _NGX_COMMON_H_INCLUDED_
#define _NGX_COMMON_H_INCLUDED_
//#include <ngx_config.h>
//#include <ngx_core.h>
//#if (NGX_THREADS)
#include <stdint.h>
//#include <sys/types.h>
//#include <sys/time.h>
#include <unistd.h>
//#include <stdarg.h>
//#include <stddef.h> /* offsetof() */
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
#include <pthread.h>
#include <sys/syscall.h>
#define NGX_OK 0
#define NGX_ERROR -1
#define NGX_AGAIN -2
#define NGX_BUSY -3
#define NGX_DONE -4
#define NGX_DECLINED -5
#define NGX_ABORT -6
typedef intptr_t ngx_int_t;
typedef uintptr_t ngx_uint_t;
typedef int ngx_err_t;
//have sched.h
#define NGX_HAVE_SCHED_YIELD 1
#if (NGX_HAVE_SCHED_YIELD)
#define ngx_sched_yield() sched_yield()
#else
#define ngx_sched_yield() usleep(1)
#endif
#define ngx_memzero(buf, n) (void) memset(buf, 0, n)
#define ngx_memset(buf, c, n) (void) memset(buf, c, n)
#define NGX_LINUX 1
#endif /* _NGX_COMMON_H_INCLUDED_ */
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/jxva/ngx_thread.git
git@gitee.com:jxva/ngx_thread.git
jxva
ngx_thread
ngx_thread
master

搜索帮助