/*
----------------------------------------------------------------------
multi-thread handling

this feature owes it's existance to Callum Gibson in australia because
without his expertise and advice it would never have been completed.
----------------------------------------------------------------------

         +----------------------------------------------------+
         |  Worldwide Copyright (c) Byte Designs Ltd (2001)   |    
         |                                                    |
         |               20568 - 32 Avenue                    |
         |               LANGLEY, BC                          |
         |               V3A 4P5 CANADA                       |
         |                                                    |
         |            Sales: sales@bytedesigns.com            |
         |          Support: support@bytedesigns.com          |
         | Phone: (604) 534 0722      Fax: (604) 534 2601     |
         +----------------------------------------------------+
                            Version 6.12
 
----------------------------------------------------------------------
*/

#if( ISTHREADED == 0 )              /* not threaded */
#define ISMTINIT(I) ;;
#define ISMTBEG(I)  ;;
#define ISMTEND(I)  ;;
#define ISMTDROP(I) ;;
#endif


#if( ISTHREADED == 1 )              /* SunOS */
#include <lwp/lwp.h>
#define ISMTLOCK     mon_t
#define ISMTINIT(MX) mon_create( &(MX) )
#define ISMTBEG(MX)  mon_enter( MX )
#define ISMTEND(MX)  mon_exit( MX )
#define ISMTDROP(MX) mon_destroy( MX )
#endif


#if( ISTHREADED == 2 )              /* Solaris */
#include <synch.h>
#define ISMTLOCK     mutex_t
#define ISMTINIT(MX) mutex_init( &(MX), USYNC_THREAD, NULL )
#define ISMTBEG(MX)  mutex_lock( &(MX) )
#define ISMTEND(MX)  mutex_unlock( &(MX) )
#define ISMTDROP(MX) mutex_destroy( &(MX) )
#endif


#if( ISTHREADED == 5 )              /* pthreads 0.9.2 */
#include <pthread.h>
#define ISMTLOCK     pthread_mutex_t
#ifdef _INCLUDE_HPUX_SOURCE
# define ISMTINIT(MX) pthread_mutex_init( &(MX), pthread_mutexattr_default )
#else
# define ISMTINIT(MX) pthread_mutex_init( &(MX), NULL )
#endif
#define ISMTBEG(MX)  pthread_mutex_lock( &(MX) )
#define ISMTEND(MX)  pthread_mutex_unlock( &(MX) )
#define ISMTDROP(MX) pthread_mutex_destroy( &(MX) )
#endif

