@@ -38,7 +38,6 @@ typedef struct {
3838 task_system * tasks ;
3939 platform_thread this_thread_id ; // OS-generated thread ID
4040 threadid exp_thread_idx ; // Splinter-generated expected thread index
41- uint64 active_threads_bitmask ;
4241} thread_config ;
4342
4443// Configuration for worker threads used in lock-step testing exercise
@@ -89,8 +88,6 @@ CTEST_DATA(task_system)
8988 // Following get setup pointing to allocated memory
9089 platform_io_handle * ioh ; // Only prerequisite needed to setup task system
9190 task_system * tasks ;
92-
93- uint64 active_threads_bitmask ;
9491};
9592
9693/*
@@ -138,22 +135,6 @@ CTEST_SETUP(task_system)
138135
139136 // Main task (this thread) is at index 0
140137 ASSERT_EQUAL (0 , platform_get_tid ());
141-
142- // Main thread should now be marked as being active in the bitmask.
143- // Active threads have their bit turned -OFF- in this bitmask.
144- uint64 task_bitmask = task_active_tasks_mask (data -> tasks );
145- uint64 all_threads_inactive_mask = (~0L );
146- uint64 this_thread_active_mask = (~0x1L );
147- uint64 exp_bitmask = (all_threads_inactive_mask & this_thread_active_mask );
148-
149- ASSERT_EQUAL (exp_bitmask ,
150- task_bitmask ,
151- "exp_bitmask=0x%x, task_bitmask=0x%x\n" ,
152- exp_bitmask ,
153- task_bitmask );
154-
155- // Save it off, so it can be used for verification in a test case.
156- data -> active_threads_bitmask = exp_bitmask ;
157138}
158139
159140// Teardown function for suite, called after every test in suite
@@ -209,8 +190,7 @@ CTEST2(task_system, test_one_thread_using_lower_apis)
209190 thread_cfg .tasks = data -> tasks ;
210191
211192 // Main thread is at index 0
212- thread_cfg .exp_thread_idx = 1 ;
213- thread_cfg .active_threads_bitmask = task_active_tasks_mask (data -> tasks );
193+ thread_cfg .exp_thread_idx = 1 ;
214194
215195 platform_status rc = STATUS_OK ;
216196
@@ -264,8 +244,7 @@ CTEST2(task_system, test_one_thread_using_extern_apis)
264244 thread_cfg .tasks = data -> tasks ;
265245
266246 // Main thread is at index 0
267- thread_cfg .exp_thread_idx = 1 ;
268- thread_cfg .active_threads_bitmask = task_active_tasks_mask (data -> tasks );
247+ thread_cfg .exp_thread_idx = 1 ;
269248
270249 platform_status rc = STATUS_OK ;
271250
@@ -363,26 +342,6 @@ CTEST2(task_system, test_task_system_creation_with_bg_threads)
363342 task_system_destroy (data -> hid , & data -> tasks );
364343 platform_status rc = create_task_system_with_bg_threads (data , 2 , 4 );
365344 ASSERT_TRUE (SUCCESS (rc ));
366-
367- uint64 all_threads_inactive_mask = (~0L );
368-
369- // Construct known bit-mask for active threads knowing that the background
370- // threads are started up when task system is created w/bg threads.
371- threadid max_thread_id = task_get_max_tid (data -> tasks );
372- uint64 active_threads_mask = 0 ;
373- for (int tid = 0 ; tid < max_thread_id ; tid ++ ) {
374- active_threads_mask |= (1L << tid );
375- }
376- active_threads_mask = ~active_threads_mask ;
377-
378- uint64 exp_bitmask = (all_threads_inactive_mask & active_threads_mask );
379- uint64 task_bitmask = task_active_tasks_mask (data -> tasks );
380-
381- ASSERT_EQUAL (exp_bitmask ,
382- task_bitmask ,
383- "exp_bitmask=0x%x, task_bitmask=0x%x\n" ,
384- exp_bitmask ,
385- task_bitmask );
386345}
387346
388347/*
@@ -533,52 +492,18 @@ exec_one_thread_use_lower_apis(void *arg)
533492{
534493 thread_config * thread_cfg = (thread_config * )arg ;
535494
536- uint64 task_bitmask_before_register =
537- task_active_tasks_mask (thread_cfg -> tasks );
538-
539- // Verify that the state of active-threads bitmask (managed by Splinter) has
540- // not changed just by creating this pthread. It should be the same as what
541- // we had recorded just prior to platform_thread_create().
542- ASSERT_EQUAL (thread_cfg -> active_threads_bitmask ,
543- task_bitmask_before_register );
544-
545- CTEST_LOG_INFO ("active_threads_bitmask=0x%lx\n" ,
546- thread_cfg -> active_threads_bitmask );
547-
548495 // This is the important call to initialize thread-specific stuff in
549496 // Splinter's task-system, which sets up the thread-id (index) and records
550497 // this thread as active with the task system.
551498 task_register_this_thread (thread_cfg -> tasks , trunk_get_scratch_size ());
552499
553- uint64 task_bitmask_after_register =
554- task_active_tasks_mask (thread_cfg -> tasks );
555-
556- // _Now, the active tasks bitmask should have changed.
557- ASSERT_NOT_EQUAL (task_bitmask_before_register , task_bitmask_after_register );
558-
559500 threadid this_threads_idx = platform_get_tid ();
560501 ASSERT_EQUAL (thread_cfg -> exp_thread_idx ,
561502 this_threads_idx ,
562503 "exp_thread_idx=%lu, this_threads_idx=%lu\n" ,
563504 thread_cfg -> exp_thread_idx ,
564505 this_threads_idx );
565506
566- // This thread is recorded as 'being active' by clearing its bit from the
567- // mask.
568- uint64 exp_bitmask = (0x1L << this_threads_idx );
569- exp_bitmask = (task_bitmask_before_register & ~exp_bitmask );
570-
571- CTEST_LOG_INFO ("this_threads_idx=%lu"
572- ", task_bitmask_before_register=0x%lx"
573- ", task_bitmask_after_register=0x%lx"
574- ", exp_bitmask=0x%lx\n" ,
575- this_threads_idx ,
576- task_bitmask_before_register ,
577- task_bitmask_after_register ,
578- exp_bitmask );
579-
580- ASSERT_EQUAL (task_bitmask_after_register , exp_bitmask );
581-
582507 // Registration should have allocated some scratch space memory.
583508 ASSERT_TRUE (
584509 task_system_get_thread_scratch (thread_cfg -> tasks , platform_get_tid ())
@@ -591,12 +516,6 @@ exec_one_thread_use_lower_apis(void *arg)
591516
592517 task_deregister_this_thread (thread_cfg -> tasks );
593518
594- uint64 task_bitmask_after_deregister =
595- task_active_tasks_mask (thread_cfg -> tasks );
596-
597- // De-registering this task removes it from the active tasks mask
598- ASSERT_EQUAL (task_bitmask_before_register , task_bitmask_after_deregister );
599-
600519 // Deregistration releases scratch space memory.
601520 ASSERT_TRUE (
602521 task_system_get_thread_scratch (thread_cfg -> tasks , this_threads_idx )
@@ -628,25 +547,9 @@ exec_one_thread_use_extern_apis(void *arg)
628547{
629548 thread_config * thread_cfg = (thread_config * )arg ;
630549
631- uint64 bitmask_before_thread_create = thread_cfg -> active_threads_bitmask ;
632-
633- uint64 bitmask_after_thread_create =
634- task_active_tasks_mask (thread_cfg -> tasks );
635-
636- // The task_thread_create() -> task_invoke_with_hooks() also registers this
637- // thread with Splinter. First, confirm that the bitmask has changed from
638- // what it was before this thread was invoked.
639- ASSERT_NOT_EQUAL (bitmask_before_thread_create , bitmask_after_thread_create );
640-
641550 threadid this_threads_idx = platform_get_tid ();
642551 ASSERT_EQUAL (thread_cfg -> exp_thread_idx , this_threads_idx );
643552
644- // This thread is recorded as 'being active' by clearing its bit from the
645- // mask. Verify the expected task bitmask.
646- uint64 exp_bitmask = (0x1L << this_threads_idx );
647- exp_bitmask = (bitmask_before_thread_create & ~exp_bitmask );
648- ASSERT_EQUAL (bitmask_after_thread_create , exp_bitmask );
649-
650553 /*
651554 * Dead Code Warning!
652555 * The interface used here has already registered this thread. An attempt to
0 commit comments