Lines Matching refs:ret
51 int ret = pthread_cond_init(&cond_, &cond_attr); in InitWorker() local
52 if (ret) { in InitWorker()
53 ALOGE("Failed to int thread %s condition %d", name_.c_str(), ret); in InitWorker()
54 return ret; in InitWorker()
57 ret = pthread_mutex_init(&lock_, NULL); in InitWorker()
58 if (ret) { in InitWorker()
59 ALOGE("Failed to init thread %s lock %d", name_.c_str(), ret); in InitWorker()
61 return ret; in InitWorker()
64 ret = pthread_create(&thread_, NULL, InternalRoutine, this); in InitWorker()
65 if (ret) { in InitWorker()
66 ALOGE("Could not create thread %s %d", name_.c_str(), ret); in InitWorker()
69 return ret; in InitWorker()
104 int ret = Lock(); in Signal() local
105 if (ret) { in Signal()
106 ALOGE("Failed to acquire lock in Signal() %d\n", ret); in Signal()
107 return ret; in Signal()
112 ret = Unlock(); in Signal()
113 if (ret) { in Signal()
114 ALOGE("Failed to release lock in Signal() %d\n", ret); in Signal()
115 return ret; in Signal()
121 int ret = Lock(); in Exit() local
122 if (ret) { in Exit()
123 ALOGE("Failed to acquire lock in Exit() %d\n", ret); in Exit()
124 return ret; in Exit()
129 ret = Unlock(); in Exit()
130 if (ret) { in Exit()
131 ALOGE("Failed to release lock in Exit() %d\n", ret); in Exit()
132 return ret; in Exit()
141 int ret = 0; in WaitForSignalOrExitLocked() local
143 ret = pthread_cond_wait(&cond_, &lock_); in WaitForSignalOrExitLocked()
146 ret = clock_gettime(CLOCK_MONOTONIC, &abs_deadline); in WaitForSignalOrExitLocked()
147 if (ret) in WaitForSignalOrExitLocked()
148 return ret; in WaitForSignalOrExitLocked()
152 ret = pthread_cond_timedwait(&cond_, &lock_, &abs_deadline); in WaitForSignalOrExitLocked()
153 if (ret == ETIMEDOUT) in WaitForSignalOrExitLocked()
154 ret = -ETIMEDOUT; in WaitForSignalOrExitLocked()
160 return ret; in WaitForSignalOrExitLocked()
170 int ret = worker->Lock(); in InternalRoutine() local
171 if (ret) { in InternalRoutine()
172 ALOGE("Failed to lock %s thread %d", worker->name_.c_str(), ret); in InternalRoutine()
178 ret = worker->Unlock(); in InternalRoutine()
179 if (ret) { in InternalRoutine()
180 ALOGE("Failed to unlock %s thread %d", worker->name_.c_str(), ret); in InternalRoutine()
195 int ret = pthread_cond_signal(&cond_); in SignalThreadLocked() local
196 if (ret) { in SignalThreadLocked()
197 ALOGE("Failed to signal condition on %s thread %d", name_.c_str(), ret); in SignalThreadLocked()
198 return ret; in SignalThreadLocked()