aboutsummaryrefslogtreecommitdiff
path: root/src/jthread/pthread/jsemaphore.cpp
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2013-12-01 01:52:06 +0100
committersapier <Sapier at GMX dot net>2013-12-01 16:25:46 +0100
commit04e9a9d5410a151d232a577b46791d2edffba527 (patch)
tree26d014a8ba5a9d962f9458f11d23f11f09ab5fff /src/jthread/pthread/jsemaphore.cpp
parentf3439c40d85967c4f66eeefbc325f9ebf94d75e1 (diff)
downloadhax-minetest-server-04e9a9d5410a151d232a577b46791d2edffba527.tar.gz
hax-minetest-server-04e9a9d5410a151d232a577b46791d2edffba527.zip
Cleanup jthread and fix win32 build
Diffstat (limited to 'src/jthread/pthread/jsemaphore.cpp')
-rw-r--r--src/jthread/pthread/jsemaphore.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/jthread/pthread/jsemaphore.cpp b/src/jthread/pthread/jsemaphore.cpp
index 963ac83cf..31bf39466 100644
--- a/src/jthread/pthread/jsemaphore.cpp
+++ b/src/jthread/pthread/jsemaphore.cpp
@@ -16,26 +16,27 @@ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <assert.h>
#include "jthread/jsemaphore.h"
JSemaphore::JSemaphore() {
- sem_init(&m_semaphore,0,0);
+ assert(sem_init(&m_semaphore,0,0) == 0);
}
JSemaphore::~JSemaphore() {
- sem_destroy(&m_semaphore);
+ assert(sem_destroy(&m_semaphore) == 0);
}
JSemaphore::JSemaphore(int initval) {
- sem_init(&m_semaphore,0,initval);
+ assert(sem_init(&m_semaphore,0,initval) == 0);
}
void JSemaphore::Post() {
- sem_post(&m_semaphore);
+ assert(sem_post(&m_semaphore) == 0);
}
void JSemaphore::Wait() {
- sem_wait(&m_semaphore);
+ assert(sem_wait(&m_semaphore) == 0);
}
int JSemaphore::GetValue() {