tls.h

来自「Lido PXA270平台开发板的最新BSP,包括源代码」· C头文件 代码 · 共 83 行

H
83
字号
#ifndef _tls_h_
#define _tls_h_

#include "drvegl.h"
#include "servicesglue.h"


/* If you wish to add a new thread with its own TLS, add it here */


struct tls_tag
{
    /* user count for this TLS, should never exceed 1 */
    EGLint count;
    
    /* The last EGL non EGL_SUCCESS error code returned by an EGL API call */
    EGLint lastError;
	
    EGLSurface currentReadSurface;
    EGLSurface currentDrawSurface;
    EGLContext currentContext;
    GLESSysContext servicesContext;
    EGLint dpyCount;
    KEGL_DISPLAY *dpys;
};
typedef struct tls_tag *TLS;


/*----------------------------------------------------------------------------*/

/* Functions for use by EGL only */

/*
<function>
   FUNCTION   : EGLGetTLSValue ()
   PURPOSE    : Retrieves EGL's value from thread local storage
   PARAMETERS : None
   RETURNS    : IMG_TRUE, if successful
</function>
 */
IMG_VOID *
EGLGetTLSValue (IMG_VOID);

   
/*
<function>
   FUNCTION   : EGLSetTLSValue ()
   PURPOSE    : Sets EGL's value in thread local storage
   PARAMETERS : pvA - Pointer to the value to set
   RETURNS    : IMG_TRUE, if successful
</function>
 */
IMG_BOOL
EGLSetTLSValue (IMG_VOID *pvA);


/*
<function>
   FUNCTION   : TLS_Open ()
   PURPOSE    : Open the thread local storage, when all openers have closed,
                thread local storage is deallocated.
   PARAMETERS : In:  init - Initialise TLS structure.
   RETURNS    : Pointer to this threads local storage structure.   
</function>
 */
TLS
TLS_Open (EGLBoolean (*init) (TLS tls));

/*
<function>
   FUNCTION   : TLS_Close ()
   PURPOSE    : Close the thread local storage, when all openers have closed,
                thread local storage is deallocated.
   PARAMETERS : None.
   RETURNS    : Pointer to this threads local storage structure.
   
</function>
 */
void
TLS_Close (void);

#endif

⌨️ 快捷键说明

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