This commit is contained in:
Haojun Liao 2020-10-13 11:47:45 +08:00
parent c6479a148a
commit 66ab0cd04c
1 changed files with 16 additions and 0 deletions

View File

@ -36,3 +36,19 @@ int64_t taosGetPthreadId() {
bool taosComparePthread(pthread_t first, pthread_t second) { bool taosComparePthread(pthread_t first, pthread_t second) {
return first.p == second.p; return first.p == second.p;
} }
int32_t taosGetPId() {
return GetCurrentProcessId();
}
int32_t taosGetCurrentAPPName(char *name, int32_t* len) {
char filepath[1024] = {0};
GetModuleFileName(NULL, filepath, MAX_PATH);
*strrchr(filepath,'.') = '\0';
strcpy(name, filepath);
if (len != NULL) {
len = strlen(filepath);
}
}