]> pd.if.org Git - liblfds/blob - liblfds/liblfds7.1.0/test_and_benchmark/libtest/src/libtest_threadset/libtest_threadset_add.c
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds7.1.0 / test_and_benchmark / libtest / src / libtest_threadset / libtest_threadset_add.c
1 /***** includes *****/
2 #include "libtest_threadset_internal.h"
3
4
5
6
7
8 /****************************************************************************/
9 void libtest_threadset_add_thread( struct libtest_threadset_state *ts,
10                                    struct libtest_threadset_per_thread_state *pts,
11                                    struct libtest_logical_processor *lp,
12                                    libshared_pal_thread_return_t (LIBSHARED_PAL_THREAD_CALLING_CONVENTION *thread_function)( void *thread_user_state ),
13                                    void *user_state )
14 {
15   LFDS710_PAL_ASSERT( ts != NULL );
16   LFDS710_PAL_ASSERT( pts != NULL );
17   LFDS710_PAL_ASSERT( lp != NULL );
18   LFDS710_PAL_ASSERT( thread_function != NULL );
19   // TRD : user_state can be NULL
20
21   pts->thread_ready_flag = LOWERED;
22   pts->threadset_start_flag = &ts->threadset_start_flag;
23   pts->pti.logical_processor_number = lp->logical_processor_number;
24   pts->pti.windows_processor_group_number = lp->windows_processor_group_number;
25   pts->pti.thread_function = thread_function;
26   pts->ts = ts;
27   pts->pti.thread_argument = pts;
28   pts->user_state = user_state;
29
30   LFDS710_LIST_ASU_SET_VALUE_IN_ELEMENT( pts->lasue, pts );
31   lfds710_list_asu_insert_at_start( &ts->list_of_per_thread_states, &pts->lasue );
32
33   return;
34 }
35