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

Side by Side Diff: fusl/src/thread/__lock.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 "pthread_impl.h" 1 #include "pthread_impl.h"
2 2
3 void __lock(volatile int *l) 3 void __lock(volatile int* l) {
4 { 4 if (libc.threads_minus_1)
5 » if (libc.threads_minus_1) 5 while (a_swap(l, 1))
6 » » while (a_swap(l, 1)) __wait(l, l+1, 1, 1); 6 __wait(l, l + 1, 1, 1);
7 } 7 }
8 8
9 void __unlock(volatile int *l) 9 void __unlock(volatile int* l) {
10 { 10 if (l[0]) {
11 » if (l[0]) { 11 a_store(l, 0);
12 » » a_store(l, 0); 12 if (l[1])
13 » » if (l[1]) __wake(l, 1, 1); 13 __wake(l, 1, 1);
14 » } 14 }
15 } 15 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698