1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-08-09 03:22:45 +03:00

Made httplib_pthread_getspecific global

This commit is contained in:
Lammert Bies
2016-12-19 18:27:47 +01:00
parent 1a3447e2a1
commit f9be8dbfe4
7 changed files with 52 additions and 12 deletions

View File

@@ -0,0 +1,26 @@
# LibHTTP API Reference
### `httplib_pthread_getspecific( key );`
### Parameters
| Parameter | Type | Description |
| :--- | :--- | :--- |
|**`key`**|`pthread_key_t`|The key of the variable to retrieve|
### Return Value
| Type | Description |
| :--- | :--- |
|`void *`|Pointer to the memory area or NULL of no area could be found|
### Description
The platform independent function `httplib_pthread_getspecific()` is used to retrieve a memory area for a thread registered previously with a call to [`httplib_pthread_setspecific()`](httplib_pthread_setspecific.md). If no area could be found, the value `NULL` is returned instead. On systems which support it, the functionality is implemented as a direct call to `pthread_setspecific()`. On other systems own code is used to emulate the same behaviour.
### See Also
* [`httplib_pthread_key_create();`](httplib_pthread_key_create.md)
* [`httplib_pthread_key_delete();`](httplib_pthread_key_delete.md)
* [`httplib_pthread_self();`](httplib_pthread_self.md)
* [`httplib_pthread_setspecific();`](httplib_pthread_setspecific.md)