Tizen Native API
4.0
|
Abstracts platform threads, providing an uniform API. It's modelled after POSIX THREADS (pthreads), on Linux they are almost 1:1 mapping.
Functions | |
Eina_Thread | eina_thread_self (void) |
Returns identifier of the current thread. | |
Eina_Bool | eina_thread_equal (Eina_Thread t1, Eina_Thread t2) |
Checks if two thread identifiers are the same. | |
Eina_Bool | eina_thread_create (Eina_Thread *t, Eina_Thread_Priority prio, int affinity, Eina_Thread_Cb func, const void *data) |
Creates a new thread, setting its priority and affinity. | |
void * | eina_thread_join (Eina_Thread t) |
Joins a currently running thread, waiting until it finishes. | |
Eina_Bool | eina_thread_name_set (Eina_Thread t, const char *name) |
Sets the name of a given thread for debugging purposes. | |
Typedefs | |
typedef uintptr_t | Eina_Thread |
typedef void *(* | Eina_Thread_Cb )(void *data, Eina_Thread t) |
typedef enum _Eina_Thread_Priority | Eina_Thread_Priority |
Type for a generic thread.
Type for the definition of a thread callback function
Type to enumerate different thread priorities
Eina_Bool eina_thread_create | ( | Eina_Thread * | t, |
Eina_Thread_Priority | prio, | ||
int | affinity, | ||
Eina_Thread_Cb | func, | ||
const void * | data | ||
) |
Creates a new thread, setting its priority and affinity.
[out] | t | where to return the thread identifier. Must not be NULL . |
prio | thread priority to use, usually EINA_THREAD_BACKGROUND | |
affinity | thread affinity to use. To not set affinity use -1 . | |
func | function to run in the thread. Must not be NULL . | |
data | context data to provide to func as first argument. |
Eina_Bool eina_thread_equal | ( | Eina_Thread | t1, |
Eina_Thread | t2 | ||
) |
Checks if two thread identifiers are the same.
t1 | first thread identifier to compare. |
t2 | second thread identifier to compare. |
void* eina_thread_join | ( | Eina_Thread | t | ) |
Joins a currently running thread, waiting until it finishes.
This function will block the current thread until t finishes. The returned value is the one returned by t func()
and may be NULL
on errors. See Error to identify problems.
t | thread identifier to wait. |
func()
or NULL
on errors. Check error with Error. Eina_Bool eina_thread_name_set | ( | Eina_Thread | t, |
const char * | name | ||
) |
Sets the name of a given thread for debugging purposes.
This maps to the pthread_setname_np() GNU extension or similar if available. The name may be limited in size (possibly 16 characters including the null byte terminator). This is useful for debugging to name a thread so external tools can display a meaningful name attached to the thread.
t | thread to set the name of |
name | a string to name the thread - this cannot be NULL |
Eina_Thread eina_thread_self | ( | void | ) |
Returns identifier of the current thread.