From 673f08a995666c3e818bf0f936152f34f8b1e81e Mon Sep 17 00:00:00 2001 From: Pawel Dziepak Date: Fri, 29 Nov 2013 05:30:50 +0100 Subject: [PATCH] kernel: Make thread_block_locked() private --- headers/private/kernel/thread.h | 33 --------------------------------- src/system/kernel/thread.cpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/headers/private/kernel/thread.h b/headers/private/kernel/thread.h index 61c66387d2..a5e44d2b42 100644 --- a/headers/private/kernel/thread.h +++ b/headers/private/kernel/thread.h @@ -332,39 +332,6 @@ thread_prepare_to_block(Thread* thread, uint32 flags, uint32 type, } -/*! Blocks the current thread. - - The thread is blocked until someone else unblock it. Must be called after a - call to thread_prepare_to_block(). If the thread has already been unblocked - after the previous call to thread_prepare_to_block(), this function will - return immediately. Cf. the documentation of thread_prepare_to_block() for - more details. - - The caller must hold the scheduler lock. - - \param thread The current thread. - \return The error code passed to the unblocking function. thread_interrupt() - uses \c B_INTERRUPTED. By convention \c B_OK means that the wait was - successful while another error code indicates a failure (what that means - depends on the client code). -*/ -static inline status_t -thread_block_locked(Thread* thread) -{ - if (thread->wait.status == 1) { - // check for signals, if interruptible - if (thread_is_interrupted(thread, thread->wait.flags)) { - thread->wait.status = B_INTERRUPTED; - } else { - thread->next_state = B_THREAD_WAITING; - scheduler_reschedule(); - } - } - - return thread->wait.status; -} - - /*! Unblocks the specified blocked thread. If the thread is no longer waiting (e.g. because thread_unblock_locked() has diff --git a/src/system/kernel/thread.cpp b/src/system/kernel/thread.cpp index f3474b58ca..141486709f 100644 --- a/src/system/kernel/thread.cpp +++ b/src/system/kernel/thread.cpp @@ -2805,6 +2805,39 @@ thread_block_timeout(timer* timer) } +/*! Blocks the current thread. + + The thread is blocked until someone else unblock it. Must be called after a + call to thread_prepare_to_block(). If the thread has already been unblocked + after the previous call to thread_prepare_to_block(), this function will + return immediately. Cf. the documentation of thread_prepare_to_block() for + more details. + + The caller must hold the scheduler lock. + + \param thread The current thread. + \return The error code passed to the unblocking function. thread_interrupt() + uses \c B_INTERRUPTED. By convention \c B_OK means that the wait was + successful while another error code indicates a failure (what that means + depends on the client code). +*/ +static inline status_t +thread_block_locked(Thread* thread) +{ + if (thread->wait.status == 1) { + // check for signals, if interruptible + if (thread_is_interrupted(thread, thread->wait.flags)) { + thread->wait.status = B_INTERRUPTED; + } else { + thread->next_state = B_THREAD_WAITING; + scheduler_reschedule(); + } + } + + return thread->wait.status; +} + + /*! Blocks the current thread. The function acquires the scheduler lock and calls thread_block_locked().