diff options
author | Yunqing Wang <yunqingwang@google.com> | 2016-07-14 14:50:52 -0700 |
---|---|---|
committer | Yunqing Wang <yunqingwang@google.com> | 2016-07-21 12:28:25 -0700 |
commit | 87c6c5224d4fb261fad4f3c56336ef57b27acd47 (patch) | |
tree | 5d6e76c0f347943decb525ba965003c36fb1a97a /vp8/common/threading.h | |
parent | 16e069b8bb4d523007bf84be7c0a1bdde58539c4 (diff) | |
download | libvpx-87c6c5224d4fb261fad4f3c56336ef57b27acd47.tar libvpx-87c6c5224d4fb261fad4f3c56336ef57b27acd47.tar.gz libvpx-87c6c5224d4fb261fad4f3c56336ef57b27acd47.tar.bz2 libvpx-87c6c5224d4fb261fad4f3c56336ef57b27acd47.zip |
Revert "Amend and improve VP8 multithreading implementation"
Reverted the patch because of possible performance issue.
Change-Id: I49944f827ccd38ed194c9f8d9cb9036fa9bf79e1
Diffstat (limited to 'vp8/common/threading.h')
-rw-r--r-- | vp8/common/threading.h | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/vp8/common/threading.h b/vp8/common/threading.h index 48b89cbb0..c761ea96d 100644 --- a/vp8/common/threading.h +++ b/vp8/common/threading.h @@ -185,46 +185,6 @@ static inline int sem_destroy(sem_t *sem) { #define x86_pause_hint() #endif -#include "vpx_util/vpx_thread.h" - -static INLINE void mutex_lock(pthread_mutex_t *const mutex) { - const int kMaxTryLocks = 4000; - int locked = 0; - int i; - - for (i = 0; i < kMaxTryLocks; ++i) { - if (!pthread_mutex_trylock(mutex)) { - locked = 1; - break; - } - } - - if (!locked) pthread_mutex_lock(mutex); -} - -static INLINE int protected_read(pthread_mutex_t *const mutex, const int *p) { - int ret; - mutex_lock(mutex); - ret = *p; - pthread_mutex_unlock(mutex); - return ret; -} - -static INLINE void sync_read(pthread_mutex_t *const mutex, int mb_col, - const int *last_row_current_mb_col, - const int nsync) { - while (mb_col > (protected_read(mutex, last_row_current_mb_col) - nsync)) { - x86_pause_hint(); - thread_sleep(0); - } -} - -static INLINE void protected_write(pthread_mutex_t *mutex, int *p, int v) { - mutex_lock(mutex); - *p = v; - pthread_mutex_unlock(mutex); -} - #endif /* CONFIG_OS_SUPPORT && CONFIG_MULTITHREAD */ #ifdef __cplusplus |