Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4cbfc4f8
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4cbfc4f8
编写于
2月 28, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
869d3c17
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
44 addition
and
39 deletion
+44
-39
include/util/tversion.h
include/util/tversion.h
+3
-3
include/util/tworker.h
include/util/tworker.h
+10
-10
include/util/types.h
include/util/types.h
+22
-17
include/util/version.h
include/util/version.h
+3
-3
source/util/src/tworker.c
source/util/src/tworker.c
+6
-6
未找到文件。
include/util/tversion.h
浏览文件 @
4cbfc4f8
...
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_UTIL_VERSION_H
#define _TD_UTIL_VERSION_H
#ifndef _TD_UTIL_VERSION_H
_
#define _TD_UTIL_VERSION_H
_
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -28,4 +28,4 @@ int32_t taosCheckVersionCompatible(int32_t clientVer, int32_t serverVer, int32_t
}
#endif
#endif
/*_TD_UTIL_VERSION_H*/
#endif
/*_TD_UTIL_VERSION_H
_
*/
include/util/tworker.h
浏览文件 @
4cbfc4f8
...
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_UTIL_WORKER_H
#define _TD_UTIL_WORKER_H
#ifndef _TD_UTIL_WORKER_H
_
#define _TD_UTIL_WORKER_H
_
#include "tqueue.h"
#ifdef __cplusplus
...
...
@@ -34,25 +34,25 @@ typedef struct SQWorkerPool {
int32_t
max
;
// max number of workers
int32_t
min
;
// min number of workers
int32_t
num
;
// current number of workers
STaosQset
*
qset
;
const
char
*
name
;
SQWorker
*
workers
;
STaosQset
*
qset
;
const
char
*
name
;
SQWorker
*
workers
;
pthread_mutex_t
mutex
;
}
SQWorkerPool
,
SFWorkerPool
;
typedef
struct
SWWorker
{
int32_t
id
;
// worker id
pthread_t
thread
;
// thread
STaosQall
*
qall
;
STaosQset
*
qset
;
// queue set
STaosQall
*
qall
;
STaosQset
*
qset
;
// queue set
SWWorkerPool
*
pool
;
}
SWWorker
;
typedef
struct
SWWorkerPool
{
int32_t
max
;
// max number of workers
int32_t
nextId
;
// from 0 to max-1, cyclic
const
char
*
name
;
SWWorker
*
workers
;
const
char
*
name
;
SWWorker
*
workers
;
pthread_mutex_t
mutex
;
}
SWWorkerPool
;
...
...
@@ -75,4 +75,4 @@ void tWWorkerFreeQueue(SWWorkerPool *pool, STaosQueue *queue);
}
#endif
#endif
/*_TD_UTIL_WORKER_H*/
#endif
/*_TD_UTIL_WORKER_H
_
*/
include/util/types.h
浏览文件 @
4cbfc4f8
...
...
@@ -22,14 +22,14 @@
extern
"C"
{
#endif
#define GET_INT8_VAL(x)
(*(int8_t *)(x))
#define GET_INT16_VAL(x)
(*(int16_t *)(x))
#define GET_INT32_VAL(x)
(*(int32_t *)(x))
#define GET_INT64_VAL(x)
(*(int64_t *)(x))
#define GET_UINT8_VAL(x)
(*(uint8_t*)
(x))
#define GET_UINT16_VAL(x)
(*(uint16_t *)(x))
#define GET_UINT32_VAL(x)
(*(uint32_t *)(x))
#define GET_UINT64_VAL(x)
(*(uint64_t *)(x))
#define GET_INT8_VAL(x) (*(int8_t *)(x))
#define GET_INT16_VAL(x) (*(int16_t *)(x))
#define GET_INT32_VAL(x) (*(int32_t *)(x))
#define GET_INT64_VAL(x) (*(int64_t *)(x))
#define GET_UINT8_VAL(x)
(*(uint8_t *)
(x))
#define GET_UINT16_VAL(x) (*(uint16_t *)(x))
#define GET_UINT32_VAL(x) (*(uint32_t *)(x))
#define GET_UINT64_VAL(x) (*(uint64_t *)(x))
static
FORCE_INLINE
float
taos_align_get_float
(
const
char
*
pBuf
)
{
#if __STDC_VERSION__ >= 201112L
...
...
@@ -64,17 +64,22 @@ static FORCE_INLINE double taos_align_get_double(const char *pBuf) {
// #define SET_FLOAT_PTR(x, y) { (*(int32_t*) x = *(int32_t*)y); }
// #define SET_DOUBLE_PTR(x, y) { (*(int64_t*) x = *(int64_t*)y); }
// #else
#define GET_FLOAT_VAL(x) (*(float *)(x))
#define GET_DOUBLE_VAL(x) (*(double *)(x))
#define SET_BIGINT_VAL(x, y) { (*(int64_t *)(x)) = (int64_t)(y); }
#define SET_FLOAT_VAL(x, y) { (*(float *)(x)) = (float)(y); }
#define SET_DOUBLE_VAL(x, y) { (*(double *)(x)) = (double)(y); }
#define SET_FLOAT_PTR(x, y) { (*(float *)(x)) = (*(float *)(y)); }
#define SET_DOUBLE_PTR(x, y) { (*(double *)(x)) = (*(double *)(y)); }
#define GET_FLOAT_VAL(x) (*(float *)(x))
#define GET_DOUBLE_VAL(x) (*(double *)(x))
#define SET_BIGINT_VAL(x, y) \
{ (*(int64_t *)(x)) = (int64_t)(y); }
#define SET_FLOAT_VAL(x, y) \
{ (*(float *)(x)) = (float)(y); }
#define SET_DOUBLE_VAL(x, y) \
{ (*(double *)(x)) = (double)(y); }
#define SET_FLOAT_PTR(x, y) \
{ (*(float *)(x)) = (*(float *)(y)); }
#define SET_DOUBLE_PTR(x, y) \
{ (*(double *)(x)) = (*(double *)(y)); }
// #endif
typedef
uint16_t
VarDataLenT
;
// maxVarDataLen: 32767
#define VARSTR_HEADER_SIZE
sizeof(VarDataLenT)
typedef
uint16_t
VarDataLenT
;
// maxVarDataLen: 32767
#define VARSTR_HEADER_SIZE sizeof(VarDataLenT)
#define varDataLen(v) ((VarDataLenT *)(v))[0]
#define varDataVal(v) ((void *)((char *)v + VARSTR_HEADER_SIZE))
...
...
include/util/version.h
浏览文件 @
4cbfc4f8
...
...
@@ -13,8 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_UTIL_VERSION_H
#define _TD_UTIL_VERSION_H
#ifndef _TD_UTIL_VERSION_H
_
#define _TD_UTIL_VERSION_H
_
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -30,4 +30,4 @@ extern char buildinfo[];
}
#endif
#endif
/*_TD_UTIL_VERSION_H*/
#endif
/*_TD_UTIL_VERSION_H
_
*/
source/util/src/tworker.c
浏览文件 @
4cbfc4f8
...
...
@@ -71,8 +71,8 @@ static void *tQWorkerThreadFp(SQWorker *worker) {
SQWorkerPool
*
pool
=
worker
->
pool
;
FItem
fp
=
NULL
;
void
*
msg
=
NULL
;
void
*
ahandle
=
NULL
;
void
*
msg
=
NULL
;
void
*
ahandle
=
NULL
;
int32_t
code
=
0
;
taosBlockSIGPIPE
();
...
...
@@ -151,8 +151,8 @@ static void *tFWorkerThreadFp(SQWorker *worker) {
SQWorkerPool
*
pool
=
worker
->
pool
;
FItem
fp
=
NULL
;
void
*
msg
=
NULL
;
void
*
ahandle
=
NULL
;
void
*
msg
=
NULL
;
void
*
ahandle
=
NULL
;
int32_t
code
=
0
;
taosBlockSIGPIPE
();
...
...
@@ -240,8 +240,8 @@ static void *tWWorkerThreadFp(SWWorker *worker) {
SWWorkerPool
*
pool
=
worker
->
pool
;
FItems
fp
=
NULL
;
void
*
msg
=
NULL
;
void
*
ahandle
=
NULL
;
void
*
msg
=
NULL
;
void
*
ahandle
=
NULL
;
int32_t
numOfMsgs
=
0
;
int32_t
qtype
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录