home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / ft-beta.zip / freetype / lib / ttmutex.c < prev    next >
C/C++ Source or Header  |  1997-10-06  |  2KB  |  72 lines

  1. /*******************************************************************
  2.  *
  3.  *  ttmutex.c                                                1.0
  4.  *
  5.  *    Mutual exclusion object, single-threaded implementation            
  6.  *
  7.  *  Copyright 1996, 1997 by
  8.  *  David Turner, Robert Wilhelm, and Werner Lemberg.
  9.  *
  10.  *  This file is part of the FreeType project, and may only be used
  11.  *  modified and distributed under the terms of the FreeType project
  12.  *  license, LICENSE.TXT. By continuing to use, modify or distribute 
  13.  *  this file you indicate that you have read the license and
  14.  *  understand and accept it fully.
  15.  *
  16.  *  NOTE : This is a generic non-functional implementation
  17.  *         that you are welcome to refine for your own system.
  18.  *
  19.  *         Please name your system-specific source with a
  20.  *         different name ( like ttmutex-os2.c or ttmutex-linux.c )
  21.  *         and change your makefile accordingly.
  22.  *
  23.  ******************************************************************/
  24.  
  25. #include "ttmutex.h"
  26.  
  27. const char  _ttmutex_to_satisfy_ANSI_C_[] = "";
  28. /* ANSI C prevents the compilation of empty units. We thus introduce */
  29. /* a dummy external to get rid of compiler warnings/errors.          */
  30. /* Note that gcc's -ansi -pedantic do not report any error here..    */
  31. /* Watcom, VC++ or Borland C++ do however..                          */
  32.  
  33. #ifdef TT_CONFIG_THREADS
  34.  
  35.   void  TT_Mutex_Create ( TMutex*  mutex )
  36.   {
  37.     mutex = (void*)-1;
  38.     /* Replace this line with your own mutex creation code */
  39.   }
  40.  
  41.   void  TT_Mutex_Delete ( TMutex*  mutex )
  42.   {
  43.     mutex = (void*)0;
  44.     /* Replace this line with your own mutex destruction code */
  45.   }
  46.  
  47.   void  TT_Mutex_Lock   ( TMutex*  mutex )
  48.   {
  49.     /* NOTE : It is legal to call this function with a NULL argument */
  50.     /*        in which case an immediate return is appropriate.      */
  51.  
  52.     if (!mutex)
  53.       return;
  54.  
  55.     ; /* Insert your own mutex locking code here */
  56.   }
  57.  
  58.   void  TT_Mutex_Release( TMutex*  mutex )
  59.   {
  60.     /* NOTE : It is legal to call this function with a NULL argument */
  61.     /*        in which case an immediate return is appropriate       */
  62.  
  63.     if (!mutex)
  64.       return;
  65.  
  66.     ; /* Insert your own mutex release code here */
  67.   }
  68.  
  69. #endif /* TT_CONFIG_THREADS */
  70.  
  71. /* End */
  72.