summaryrefslogtreecommitdiff
path: root/kern/mutex.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2016-12-09 01:41:06 +0100
committerRichard Braun <rbraun@sceen.net>2016-12-09 01:41:06 +0100
commit39c13b3b84b34e0938220126c8f147d2b0b6ac89 (patch)
tree92accef33f04f49a01765e00ec026b092ae0c8ca /kern/mutex.h
parent84c92cd2be8bc4aea6c14a186f79c2277f0fd4aa (diff)
Force brackets around one-line conditional statements
This change was done using astyle, with a few manual editing here and there.
Diffstat (limited to 'kern/mutex.h')
-rw-r--r--kern/mutex.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/kern/mutex.h b/kern/mutex.h
index d3fe74b5..a36ed17e 100644
--- a/kern/mutex.h
+++ b/kern/mutex.h
@@ -51,8 +51,9 @@ mutex_trylock(struct mutex *mutex)
state = mutex_tryacquire(mutex);
- if (state == MUTEX_UNLOCKED)
+ if (state == MUTEX_UNLOCKED) {
return 0;
+ }
return 1;
}
@@ -64,8 +65,9 @@ mutex_lock(struct mutex *mutex)
state = mutex_tryacquire(mutex);
- if (state == MUTEX_UNLOCKED)
+ if (state == MUTEX_UNLOCKED) {
return;
+ }
assert((state == MUTEX_LOCKED) || (state == MUTEX_CONTENDED));
@@ -79,8 +81,9 @@ mutex_unlock(struct mutex *mutex)
state = mutex_release(mutex);
- if (state == MUTEX_LOCKED)
+ if (state == MUTEX_LOCKED) {
return;
+ }
assert(state == MUTEX_CONTENDED);