⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ttmutex.c

📁 神龙卡开发原代码
💻 C
字号:
/******************************************************************* * *  ttmutex.c                                                1.0 * *    Mutual exclusion object, single-threaded implementation * *  Copyright 1996-1999 by *  David Turner, Robert Wilhelm, and Werner Lemberg. * *  This file is part of the FreeType project, and may only be used *  modified and distributed under the terms of the FreeType project *  license, LICENSE.TXT.  By continuing to use, modify, or distribute *  this file you indicate that you have read the license and *  understand and accept it fully. * *  NOTE:  This is a generic non-functional implementation *         that you are welcome to refine for your own system. * *         Please name your system-specific source with a *         different name (like ttmutex-os2.c or ttmutex-linux.c) *         and change your makefile accordingly. * ******************************************************************/#include "ttmutex.h"/* required by the tracing mode */#undef  TT_COMPONENT#define TT_COMPONENT  trace_mutex/* ANSI C prevents the compilation of empty units.  We thus introduce *//* a dummy typedef to get rid of compiler warnings/errors.            *//* Note that gcc's -ansi -pedantic does not report any error here.    *//* Watcom, VC++ or Borland C++ do however.                            */  typedef void  _ttmutex_to_satisfy_ANSI_C_;#ifdef TT_CONFIG_OPTION_THREAD_SAFE  LOCAL_FUNC  void  TT_Mutex_Create ( TMutex*  mutex )  {    *mutex = (void*)-1;    /* Replace this line with your own mutex creation code */  }  LOCAL_FUNC  void  TT_Mutex_Delete ( TMutex*  mutex )  {    *mutex = (void*)0;    /* Replace this line with your own mutex destruction code */  }  LOCAL_FUNC  void  TT_Mutex_Lock   ( TMutex*  mutex )  {    /* NOTE: It is legal to call this function with a NULL argument */    /*       in which case an immediate return is appropriate.      */    if ( !mutex )      return;    ; /* Insert your own mutex locking code here */  }  LOCAL_FUNC  void  TT_Mutex_Release( TMutex*  mutex )  {    /* NOTE: It is legal to call this function with a NULL argument */    /*       in which case an immediate return is appropriate       */    if ( !mutex )      return;    ; /* Insert your own mutex release code here */  }#endif /* TT_CONFIG_OPTION_THREAD_SAFE *//* END */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -