]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
newest version of sleep patch
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 26 Sep 2016 19:09:55 +0000 (14:09 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 26 Sep 2016 19:09:55 +0000 (14:09 -0500)
libs/libvpx/vp8/common/threading.h
libs/libvpx/vp8/decoder/threading.c
libs/libvpx/vp8/encoder/encodeframe.c
libs/libvpx/vp8/encoder/ethreading.c

index f27b209c40eb2c6d9141657fc5d9d7c69889c6f9..c829fbc279044a10f63bdf176c4b59986f029d24 100644 (file)
@@ -171,15 +171,11 @@ static inline int sem_destroy(sem_t *sem) {
 #define sem_wait(sem) (semaphore_wait(*sem))
 #define sem_post(sem) semaphore_signal(*sem)
 #define sem_destroy(sem) semaphore_destroy(mach_task_self(), *sem)
-#define thread_sleep(nms)
-/* { struct timespec ts;ts.tv_sec=0; ts.tv_nsec =
-   1000*nms;nanosleep(&ts, NULL);} */
+#define thread_sleep(nms) { struct timespec ts;ts.tv_sec=0; ts.tv_nsec = 1000*nms;nanosleep(&ts, NULL);} 
 #else
 #include <unistd.h>
 #include <sched.h>
-#define thread_sleep(nms) sched_yield();
-/* {struct timespec ts;ts.tv_sec=0;
-    ts.tv_nsec = 1000*nms;nanosleep(&ts, NULL);} */
+#define thread_sleep(nms) {struct timespec ts;ts.tv_sec=0; ts.tv_nsec = 1000*nms;nanosleep(&ts, NULL);}
 #endif
 /* Not Windows. Assume pthreads */
 
index 44ca16bfdd4bdce9e6d9eb1eb0f3c6351c198931..88f7723e33569ad62c8b3f59cbbccdb40c4199e1 100644 (file)
@@ -361,7 +361,7 @@ static void mt_decode_mb_rows(VP8D_COMP *pbi, MACROBLOCKD *xd,
       if ((mb_col & (nsync - 1)) == 0) {
         while (mb_col > (*last_row_current_mb_col - nsync)) {
           x86_pause_hint();
-          thread_sleep(0);
+          thread_sleep(1);
         }
       }
 
index e41d513c1b72eb1bc5e70153f4bec9eea2ee7d87..600ba4061bcad4d34e71f6c35ca77d7278ee982e 100644 (file)
@@ -424,7 +424,7 @@ static void encode_mb_row(VP8_COMP *cpi, VP8_COMMON *cm, int mb_row,
       if ((mb_col & (nsync - 1)) == 0) {
         while (mb_col > (*last_row_current_mb_col - nsync)) {
           x86_pause_hint();
-          thread_sleep(0);
+          thread_sleep(1);
         }
       }
     }
index 708002b1e672436eb2f36649078d712ed9548210..68ca0df08d86dba64b39c0f9c312e03962387c1e 100644 (file)
@@ -108,7 +108,7 @@ static THREAD_FUNCTION thread_encoding_proc(void *p_data) {
           if ((mb_col & (nsync - 1)) == 0) {
             while (mb_col > (*last_row_current_mb_col - nsync)) {
               x86_pause_hint();
-              thread_sleep(0);
+              thread_sleep(1);
             }
           }