From a41651b62ff13fd89aafefd5c1e0ef7a6e5b31ad Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Thu, 22 Aug 2024 18:03:49 +0800
Subject: [PATCH] rename 3rdparty to openlibs and rename CROSSTOOL to CROSS_COMPILER

---
 booster/util_proc.h |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/booster/util_proc.h b/booster/util_proc.h
index 4af3cf2..89856c6 100644
--- a/booster/util_proc.h
+++ b/booster/util_proc.h
@@ -15,6 +15,7 @@
 #define __UTIL_PROC_H_
 
 #include <signal.h>
+#include <time.h>
 
 #define PID_ASCII_SIZE  11
 
@@ -59,9 +60,30 @@
  * |   Low level API     |
  * +---------------------+*/
 
-
-
 /* get daemon process ID from $pid_file   */
 extern pid_t get_daemon_pid(const char *pid_file);
 
+/* +------------------------+
+ * |  inline functions API  |
+ * +------------------------+*/
+static inline void msleep(unsigned long ms)
+{
+    struct timespec cSleep;
+    unsigned long ulTmp;
+
+    cSleep.tv_sec = ms / 1000;
+    if (cSleep.tv_sec == 0)
+    {
+        ulTmp = ms * 10000;
+        cSleep.tv_nsec = ulTmp * 100;
+    }
+    else
+    {
+        cSleep.tv_nsec = 0;
+    }
+
+    nanosleep(&cSleep, 0);
+    return ;
+}
+
 #endif

--
Gitblit v1.9.1