diff options
| author | Martijn Coenen <maco@google.com> | 2014-04-08 21:10:16 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2014-04-08 21:10:16 +0000 |
| commit | 686b51e61ccb676f393bac12f5ff7bac4013f926 (patch) | |
| tree | fa1f9ccbb2145712e979dd5d9bdedd042918927f /halimpl | |
| parent | 622a5c6848066b473c4992ea484a3ef46da537df (diff) | |
| parent | 46abb3dcf960058e48d1444b6a11cc7e84912339 (diff) | |
| download | android_hardware_broadcom_nfc-686b51e61ccb676f393bac12f5ff7bac4013f926.tar.gz android_hardware_broadcom_nfc-686b51e61ccb676f393bac12f5ff7bac4013f926.tar.bz2 android_hardware_broadcom_nfc-686b51e61ccb676f393bac12f5ff7bac4013f926.zip | |
am 46abb3dc: Merge "Fix up pthread_cond_timedwait."
* commit '46abb3dcf960058e48d1444b6a11cc7e84912339':
Fix up pthread_cond_timedwait.
Diffstat (limited to 'halimpl')
| -rw-r--r-- | halimpl/bcm2079x/gki/ulinux/gki_ulinux.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/halimpl/bcm2079x/gki/ulinux/gki_ulinux.c b/halimpl/bcm2079x/gki/ulinux/gki_ulinux.c index 62c92a8..2f98e63 100644 --- a/halimpl/bcm2079x/gki/ulinux/gki_ulinux.c +++ b/halimpl/bcm2079x/gki/ulinux/gki_ulinux.c @@ -41,8 +41,6 @@ #define SCHED_RR 2 #define SCHED_BATCH 3 -#define pthread_cond_timedwait_monotonic pthread_cond_timedwait - #endif /* Define the structure that holds the GKI variables @@ -222,8 +220,11 @@ UINT8 GKI_create_task (TASKPTR task_entry, UINT8 task_id, INT8 *taskname, UINT16 UINT8 *p; struct sched_param param; int policy, ret = 0; + pthread_condattr_t attr; pthread_attr_t attr1; + pthread_condattr_init(&attr); + pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); GKI_TRACE_5 ("GKI_create_task func=0x%x id=%d name=%s stack=0x%x stackSize=%d", task_entry, task_id, taskname, stack, stacksize); if (task_id >= GKI_MAX_TASKS) @@ -240,9 +241,9 @@ UINT8 GKI_create_task (TASKPTR task_entry, UINT8 task_id, INT8 *taskname, UINT16 /* Initialize mutex and condition variable objects for events and timeouts */ pthread_mutex_init(&gki_cb.os.thread_evt_mutex[task_id], NULL); - pthread_cond_init (&gki_cb.os.thread_evt_cond[task_id], NULL); + pthread_cond_init (&gki_cb.os.thread_evt_cond[task_id], &attr); pthread_mutex_init(&gki_cb.os.thread_timeout_mutex[task_id], NULL); - pthread_cond_init (&gki_cb.os.thread_timeout_cond[task_id], NULL); + pthread_cond_init (&gki_cb.os.thread_timeout_cond[task_id], &attr); pthread_attr_init(&attr1); /* by default, pthread creates a joinable thread */ @@ -703,14 +704,8 @@ UINT16 GKI_wait (UINT16 flag, UINT32 timeout) } abstime.tv_sec += sec; -#if defined(__LP64__) - // STOPSHIP need pthread_condattr_setclock(..., CLOCK_MONOTONIC) pthread_cond_timedwait(&gki_cb.os.thread_evt_cond[rtask], &gki_cb.os.thread_evt_mutex[rtask], &abstime); -#else - pthread_cond_timedwait_monotonic(&gki_cb.os.thread_evt_cond[rtask], - &gki_cb.os.thread_evt_mutex[rtask], &abstime); -#endif } else |
