ObjFW
Loading...
Searching...
No Matches
Functions
OFTLSKey.h File Reference
#include "objfw-defs.h"
#include <errno.h>
#include "platform.h"
import "macros.h"

Go to the source code of this file.

Functions

int OFTLSKeyNew (OFTLSKey *key)
 Creates a new Thread Local Storage key.
 
int OFTLSKeyFree (OFTLSKey key)
 Destroys the specified Thread Local Storage key.
 
static OF_INLINE void * OFTLSKeyGet (OFTLSKey key)
 Returns the current value for the specified Thread Local Storage key.
 
static OF_INLINE int OFTLSKeySet (OFTLSKey key, void *value)
 Sets the current value for the specified Thread Local Storage key.
 

Function Documentation

◆ OFTLSKeyFree()

int OFTLSKeyFree ( OFTLSKey key)
extern

Destroys the specified Thread Local Storage key.

Parameters
keyA pointer to the key to destroy
Returns
0 on success, or an error number from <errno.h> on error

◆ OFTLSKeyGet()

static OF_INLINE void * OFTLSKeyGet ( OFTLSKey key)
static

Returns the current value for the specified Thread Local Storage key.

Parameters
keyA pointer to the key whose value to return
Returns
The current value for the specified Thread Local Storage key

◆ OFTLSKeyNew()

int OFTLSKeyNew ( OFTLSKey * key)
extern

Creates a new Thread Local Storage key.

Parameters
keyA pointer to the key to create
Returns
0 on success, or an error number from <errno.h> on error

◆ OFTLSKeySet()

static OF_INLINE int OFTLSKeySet ( OFTLSKey key,
void * value )
static

Sets the current value for the specified Thread Local Storage key.

Parameters
keyA pointer to the key whose value to set
valueThe new value for the key