diff options
| author | liuchang <[email protected]> | 2023-08-16 06:36:59 +0000 |
|---|---|---|
| committer | liuchang <[email protected]> | 2023-08-16 06:36:59 +0000 |
| commit | fedca72b7d96e7c782ddeb63a97edee37c467a09 (patch) | |
| tree | 3fee65aef2b4af4a9ce656aa221f1a95a5bf4cad /shaping/src/main.cpp | |
| parent | 099951d0bd691f35c675df6dbff3031a1a522ee6 (diff) | |
fixbug TSG-16600, change max_latency type from guage to counter for fieldstat3
Diffstat (limited to 'shaping/src/main.cpp')
| -rw-r--r-- | shaping/src/main.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/shaping/src/main.cpp b/shaping/src/main.cpp index b526ff7..91e1202 100644 --- a/shaping/src/main.cpp +++ b/shaping/src/main.cpp @@ -20,7 +20,10 @@ static void *shaper_thread_loop(void *data) { struct shaping_thread_ctx *ctx = (struct shaping_thread_ctx *)data; - marsio_thread_init(ctx->marsio_info->instance); + if (marsio_thread_init(ctx->marsio_info->instance) != 0) { + LOG_ERROR("%s: marsio_thread_init failed", LOG_TAG_SHAPING); + return NULL; + } //loop to process pkts while(!quit) { @@ -81,7 +84,10 @@ int main(int argc, char **argv) } for (int i = 0; i < ctx->thread_num; i++) { - pthread_create(&ctx->thread_ctx[i].tid, NULL, shaper_thread_loop, &ctx->thread_ctx[i]); + int ret = pthread_create(&ctx->thread_ctx[i].tid, NULL, shaper_thread_loop, &ctx->thread_ctx[i]); + if (ret < 0) { + LOG_ERROR("%s: create thread failed, error %d: %s", LOG_TAG_SHAPING, errno, strerror(errno)); + } } while(!quit) { |
