/*---------------------------------------------------------------------------* Project: OS Mutex API File: OSMutex.h Copyright (C) Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. *---------------------------------------------------------------------------*/ #ifndef __OSMUTEX_H__ #define __OSMUTEX_H__ #ifdef __cplusplus extern "C" { #endif #include #define OSMUTEX_TXT_TAG 0x6D557458 #define OSCOND_TXT_TAG 0x634E6456 struct OSMutex { u32 txtTag; // 'mUtX' 0x6D557458 char * name; // debug name or NULL u32 os_reserved1; OSThreadQueue queue; OSThread* thread; // the current owner s32 count; // lock count OSMutexLink link; // for OSThread.queueMutex }; struct OSCond { u32 txtTag; // 'cNdV' 0x634E6456 char * name; // debug name or NULL u32 os_reserved1; OSThreadQueue queue; }; void OSInitMutex ( OSMutex* mutex ); void OSInitMutexEx ( OSMutex* mutex, char * name ); void OSLockMutex ( OSMutex* mutex ); void OSUnlockMutex ( OSMutex* mutex ); BOOL OSTryLockMutex( OSMutex* mutex ); void OSInitCond ( OSCond* cond ); void OSInitCondEx ( OSCond* cond, char * name ); void OSWaitCond ( OSCond* cond, OSMutex* mutex ); void OSSignalCond ( OSCond* cond ); #ifdef __cplusplus } #endif #endif // __OSMUTEX_H__