Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Side by Side Diff: fusl/src/thread/cnd_timedwait.c

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include <threads.h> 1 #include <threads.h>
2 #include <errno.h> 2 #include <errno.h>
3 3
4 int __pthread_cond_timedwait(cnd_t *restrict, mtx_t *restrict, const struct time spec *restrict); 4 int __pthread_cond_timedwait(cnd_t* restrict,
5 mtx_t* restrict,
6 const struct timespec* restrict);
5 7
6 int cnd_timedwait(cnd_t *restrict c, mtx_t *restrict m, const struct timespec *r estrict ts) 8 int cnd_timedwait(cnd_t* restrict c,
7 { 9 mtx_t* restrict m,
8 » int ret = __pthread_cond_timedwait(c, m, ts); 10 const struct timespec* restrict ts) {
9 » switch (ret) { 11 int ret = __pthread_cond_timedwait(c, m, ts);
10 » /* May also return EINVAL or EPERM. */ 12 switch (ret) {
11 » default: return thrd_error; 13 /* May also return EINVAL or EPERM. */
12 » case 0: return thrd_success; 14 default:
13 » case ETIMEDOUT: return thrd_timedout; 15 return thrd_error;
14 » } 16 case 0:
17 return thrd_success;
18 case ETIMEDOUT:
19 return thrd_timedout;
20 }
15 } 21 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698