]> pd.if.org Git - liblfds/blob - liblfds/liblfds7.1.0/test_and_benchmark/libshared/inc/libshared/libshared_porting_abstraction_layer.h
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds7.1.0 / test_and_benchmark / libshared / inc / libshared / libshared_porting_abstraction_layer.h
1 /***** defines *****/
2 #define LIBSHARED_PAL_PTI_GET_LOGICAL_PROCESSOR_NUMBER( libshared_pal_thread_info )        (libshared_pal_thread_info).logical_processor_number
3 #define LIBSHARED_PAL_PTI_GET_WINDOWS_PROCESSOR_GROUP_NUMBER( libshared_pal_thread_info )  (libshared_pal_thread_info).windows_processor_group_number
4 #define LIBSHARED_PAL_PTI_GET_NUMA_NODE_ID( libshared_pal_thread_info )                    (libshared_pal_thread_info).numa_node_id
5 #define LIBSHARED_PAL_PTI_GET_THREAD_FUNCTION( libshared_pal_thread_info )                 (libshared_pal_thread_info).thread_function
6 #define LIBSHARED_PAL_PTI_GET_THREAD_ARGUMENT( libshared_pal_thread_info )                 (libshared_pal_thread_info).thread_argument
7
8 /***** structs *****/
9 struct libshared_pal_thread_info
10 {
11   // TRD : this struct must be user-allocated and last till the thread ends - needed for thread pinning on android
12
13   lfds710_pal_uint_t
14     logical_processor_number,
15     numa_node_id,
16     windows_processor_group_number;
17
18   libshared_pal_thread_return_t
19     (LIBSHARED_PAL_THREAD_CALLING_CONVENTION *thread_function)( void *thread_argument );
20
21   void
22     *thread_argument;
23 };
24
25 /***** public prototypes *****/
26 int libshared_pal_thread_start( libshared_pal_thread_handle_t *thread_handle,
27                                 struct libshared_pal_thread_info *pti );
28
29 void libshared_pal_thread_wait( libshared_pal_thread_handle_t thread_handle );
30