Browse Source

THREADS now defined by glthread.h, added more prototypes

tags/mesa_3_3
Brian Paul 25 years ago
parent
commit
a360ab2a33
2 changed files with 50 additions and 21 deletions
  1. 39
    5
      src/mesa/glapi/glthread.c
  2. 11
    16
      src/mesa/glapi/glthread.h

+ 39
- 5
src/mesa/glapi/glthread.c View File

/* $Id: glthread.c,v 1.4 2000/02/10 21:27:25 brianp Exp $ */
/* $Id: glthread.c,v 1.5 2000/02/10 21:54:06 brianp Exp $ */


/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
#include "all.h" #include "all.h"
#else #else
#include "glheader.h" #include "glheader.h"
#include "glthread.h"
#endif #endif





/* /*
* This file should still compile even when THREADS is not defined. * This file should still compile even when THREADS is not defined.
* This is to make things easier to deal with on the makefile scene.. * This is to make things easier to deal with on the makefile scene..
*/ */
#ifdef THREADS #ifdef THREADS
#include <errno.h> #include <errno.h>
#include "glthread.h"



/* /*
* Error messages * Error messages
#endif /* XTHREAD */ #endif /* XTHREAD */




#endif /* THREADS */


#else /* THREADS */


/*
* no-op functions
*/

unsigned long
_glthread_GetID(void)
{
return 0;
}


void
_glthread_InitTSD(_glthread_TSD *tsd)
{
(void) tsd;
}


void *
_glthread_GetTSD(_glthread_TSD *tsd)
{
(void) tsd;
return NULL;
}



void
_glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
{
(void) tsd;
(void) ptr;
}


#endif /* THREADS */

+ 11
- 16
src/mesa/glapi/glthread.h View File

/* $Id: glthread.h,v 1.3 2000/02/10 21:27:25 brianp Exp $ */
/* $Id: glthread.h,v 1.4 2000/02/10 21:54:06 brianp Exp $ */


/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
* *
*/ */



#ifndef GLTHREAD_H
#define GLTHREAD_H


/* /*
* If this file is accidentally included by a non-threaded build, * If this file is accidentally included by a non-threaded build,
* it should not cause the build to fail, or otherwise cause problems. * it should not cause the build to fail, or otherwise cause problems.
* In general, it should only be included when needed however. * In general, it should only be included when needed however.
*/ */
#ifdef THREADS
/*
* It is an error not to select a specific threads API when compiling.
*/
#if !defined(PTHREADS) && !defined(SOLARIS_THREADS) && !defined(WIN32) && !defined(XTHREADS)
#error One of PTHREADS, SOLARIS_THREADS, WIN32 or XTHREADS must be defined.


#ifndef GLTHREAD_H
#define GLTHREAD_H


#if defined(PTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(XTHREADS)
#define THREADS
#endif #endif




* compiler flag. On Solaris with gcc, use -D_REENTRANT to enable * compiler flag. On Solaris with gcc, use -D_REENTRANT to enable
* proper compiling for MT-safe libc etc. * proper compiling for MT-safe libc etc.
*/ */
#ifdef PTHREADS
#if defined(PTHREADS)
#include <pthread.h> /* POSIX threads headers */ #include <pthread.h> /* POSIX threads headers */


typedef struct { typedef struct {






#else /* THREADS */


#ifndef THREADS


/* /*
* THREADS not defined * THREADS not defined


#define _glthread_UNLOCK_MUTEX(name) (void) name #define _glthread_UNLOCK_MUTEX(name) (void) name



#endif /* THREADS */ #endif /* THREADS */











#endif /* THREADS_H */ #endif /* THREADS_H */



Loading…
Cancel
Save