Artifact e655c5c2cfd581f765da8716f8e47c9e790246a95c4b2ab87292214602c600ca:
- File
src/platform/amiga/mutex.m
— part of check-in
[dfd52d5220]
at
2021-04-17 16:24:13
on branch new-naming-convention
— of_mutex_t -> OFPlainMutex
Also rename of_rmutex_t -> OFPlainRecursiveMutex. (user: js, size: 1535) [annotate] [blame] [check-ins using]
/* * Copyright (c) 2008-2021 Jonathan Schleifer <js@nil.im> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" #include <errno.h> #import "mutex.h" #include <proto/exec.h> int OFPlainMutexNew(OFPlainMutex *mutex) { InitSemaphore(mutex); return 0; } int OFPlainMutexLock(OFPlainMutex *mutex) { ObtainSemaphore(mutex); return 0; } int OFPlainMutexTryLock(OFPlainMutex *mutex) { if (!AttemptSemaphore(mutex)) return EBUSY; return 0; } int OFPlainMutexUnlock(OFPlainMutex *mutex) { ReleaseSemaphore(mutex); return 0; } int OFPlainMutexFree(OFPlainMutex *mutex) { return 0; } int OFPlainRecursiveMutexNew(OFPlainRecursiveMutex *rmutex) { return OFPlainMutexNew(rmutex); } int OFPlainRecursiveMutexLock(OFPlainRecursiveMutex *rmutex) { return OFPlainMutexLock(rmutex); } int OFPlainRecursiveMutexTryLock(OFPlainRecursiveMutex *rmutex) { return OFPlainMutexTryLock(rmutex); } int OFPlainRecursiveMutexUnlock(OFPlainRecursiveMutex *rmutex) { return OFPlainMutexUnlock(rmutex); } int OFPlainRecursiveMutexFree(OFPlainRecursiveMutex *rmutex) { return OFPlainMutexFree(rmutex); }