Skip to content

Commit

Permalink
sema: style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Jan 23, 2016
1 parent 632c9a2 commit d5af07c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sys/sema/sema.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ int sema_destroy(sema_t *sema)
{
unsigned int old_state;
priority_queue_node_t *next;

if (sema == NULL) {
return -EINVAL;
}
Expand All @@ -68,6 +69,7 @@ int sema_wait_timed_msg(sema_t *sema, uint64_t timeout, msg_t *msg)
unsigned old_state;
msg_t timeout_msg;
xtimer_t timeout_timer;

if (sema == NULL) {
return -EINVAL;
}
Expand Down Expand Up @@ -128,20 +130,21 @@ int sema_wait_timed_msg(sema_t *sema, uint64_t timeout, msg_t *msg)
int sema_wait_timed(sema_t *sema, uint64_t timeout)
{
int result;

do {
msg_t msg;
result = sema_wait_timed_msg(sema, timeout, &msg);
DEBUG("sema_wait: %" PRIkernel_pid ": Discarding message from %" PRIkernel_pid "\n",
sched_active_thread->pid, msg->sender_pid);
}
while (result == -EAGAIN);
} while (result == -EAGAIN);
return result;
}

int sema_post(sema_t *sema)
{
unsigned int old_state, value;
priority_queue_node_t *next;

if (sema == NULL) {
return -EINVAL;
}
Expand Down

0 comments on commit d5af07c

Please sign in to comment.