minor changes
This commit is contained in:
parent
6799376107
commit
6ed41e2a0c
|
@ -14,8 +14,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _DEFAULT_SOURCE
|
#define _DEFAULT_SOURCE
|
||||||
#include "tutil.h"
|
|
||||||
#include "tlog.h"
|
#include "tlog.h"
|
||||||
|
#include "tutil.h"
|
||||||
|
|
||||||
#define LOG_MAX_LINE_SIZE (1000)
|
#define LOG_MAX_LINE_SIZE (1000)
|
||||||
#define LOG_MAX_LINE_BUFFER_SIZE (LOG_MAX_LINE_SIZE + 10)
|
#define LOG_MAX_LINE_BUFFER_SIZE (LOG_MAX_LINE_SIZE + 10)
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
#define _DEFAULT_SOURCE
|
#define _DEFAULT_SOURCE
|
||||||
#include "tthread.h"
|
#include "tthread.h"
|
||||||
|
|
||||||
// create new thread
|
|
||||||
pthread_t* taosCreateThread(void* (*__start_routine)(void*), void* param) {
|
pthread_t* taosCreateThread(void* (*__start_routine)(void*), void* param) {
|
||||||
pthread_t* pthread = (pthread_t*)malloc(sizeof(pthread_t));
|
pthread_t* pthread = (pthread_t*)malloc(sizeof(pthread_t));
|
||||||
pthread_attr_t thattr;
|
pthread_attr_t thattr;
|
||||||
|
@ -32,7 +31,6 @@ pthread_t* taosCreateThread(void* (*__start_routine)(void*), void* param) {
|
||||||
return pthread;
|
return pthread;
|
||||||
}
|
}
|
||||||
|
|
||||||
// destory thread
|
|
||||||
bool taosDestoryThread(pthread_t* pthread) {
|
bool taosDestoryThread(pthread_t* pthread) {
|
||||||
if (pthread == NULL) return false;
|
if (pthread == NULL) return false;
|
||||||
if (taosThreadRunning(pthread)) {
|
if (taosThreadRunning(pthread)) {
|
||||||
|
@ -44,7 +42,6 @@ bool taosDestoryThread(pthread_t* pthread) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// thread running return true
|
|
||||||
bool taosThreadRunning(pthread_t* pthread) {
|
bool taosThreadRunning(pthread_t* pthread) {
|
||||||
if (pthread == NULL) return false;
|
if (pthread == NULL) return false;
|
||||||
int32_t ret = pthread_kill(*pthread, 0);
|
int32_t ret = pthread_kill(*pthread, 0);
|
||||||
|
|
Loading…
Reference in New Issue