Chromium Code Reviews

Unified Diff: fusl/src/thread/pthread_rwlock_tryrdlock.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.
Jump to:
View side-by-side diff with in-line comments
Index: fusl/src/thread/pthread_rwlock_tryrdlock.c
diff --git a/fusl/src/thread/pthread_rwlock_tryrdlock.c b/fusl/src/thread/pthread_rwlock_tryrdlock.c
index fa271fcc6a156a78e9dfe975bf084113e3aa3167..0246fc5f9e044cee6ccf323c0cca6e7b350f2e67 100644
--- a/fusl/src/thread/pthread_rwlock_tryrdlock.c
+++ b/fusl/src/thread/pthread_rwlock_tryrdlock.c
@@ -1,13 +1,14 @@
#include "pthread_impl.h"
-int pthread_rwlock_tryrdlock(pthread_rwlock_t *rw)
-{
- int val, cnt;
- do {
- val = rw->_rw_lock;
- cnt = val & 0x7fffffff;
- if (cnt == 0x7fffffff) return EBUSY;
- if (cnt == 0x7ffffffe) return EAGAIN;
- } while (a_cas(&rw->_rw_lock, val, val+1) != val);
- return 0;
+int pthread_rwlock_tryrdlock(pthread_rwlock_t* rw) {
+ int val, cnt;
+ do {
+ val = rw->_rw_lock;
+ cnt = val & 0x7fffffff;
+ if (cnt == 0x7fffffff)
+ return EBUSY;
+ if (cnt == 0x7ffffffe)
+ return EAGAIN;
+ } while (a_cas(&rw->_rw_lock, val, val + 1) != val);
+ return 0;
}

Powered by Google App Engine