diff options
| author | 杨威 <[email protected]> | 2023-06-30 20:53:48 +0800 |
|---|---|---|
| committer | 杨威 <[email protected]> | 2023-06-30 22:35:53 +0800 |
| commit | 1d2c42ee129184237c877b49e5e8cc42ac4c8d60 (patch) | |
| tree | 1d17077c9caaa9f59e60824303f7010061fc8ca5 /src/dealpkt/plug_support.c | |
| parent | 791860229367b7e7b0513d14553767d512579254 (diff) | |
🦄 refactor(marsio4_worker): 重构调用polling_stream_timeout逻辑,减少1s内的重复调用
Diffstat (limited to 'src/dealpkt/plug_support.c')
| -rw-r--r-- | src/dealpkt/plug_support.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dealpkt/plug_support.c b/src/dealpkt/plug_support.c index a6c068d..d6d0afa 100644 --- a/src/dealpkt/plug_support.c +++ b/src/dealpkt/plug_support.c @@ -1932,7 +1932,10 @@ long long sapp_random(void) int sapp_usleep(int usec)
{
struct timespec sleep_time_val;
-
+ if(unlikely (usec <= 0))
+ {
+ return 0;
+ }
sleep_time_val.tv_sec = 0;
sleep_time_val.tv_nsec = usec * 1000;
|
