@@ -508,7 +508,7 @@ int __ztdc_win32_thrd_create_attrs_err(thrd_t* __thr, thrd_start_t __func, void*
508508 // store to invoke later (on the new thread, if success)
509509 ztdc_thrd_attr_custom_on_new * __attr = (ztdc_thrd_attr_custom_on_new * )__attr_kind ;
510510 __trampoline_userdata -> __custom_on_new_attr = __attr ;
511- }
511+ } break ;
512512 default :
513513 // unrecognized attribute
514514 __attr_err = thrd_error ;
@@ -518,7 +518,7 @@ int __ztdc_win32_thrd_create_attrs_err(thrd_t* __thr, thrd_start_t __func, void*
518518 int __attr_err_res = __attr_err_func (__attr_kind , __attr_err , __attr_err_func_arg );
519519 if (__attr_err_res != thrd_success ) {
520520 free (__trampoline_userdata );
521- return thrd_success ;
521+ return __attr_err_res ;
522522 }
523523 }
524524 }
@@ -661,32 +661,34 @@ int __ztdc_win32_thrd_create_attrs_err(thrd_t* __thr, thrd_start_t __func, void*
661661 // spinlock until the thread is started and all internal work is okay.
662662 }
663663 // return any from-thread failures and bail if necessary
664- int __post_thread_start_results = __sync_result ;
665- if (__post_thread_start_results != thrd_success ) {
666- __post_thread_start_results = __attr_err_func (__sync_kind , __post_thread_start_results , __attr_err_func_arg );
667- __sync_result = __post_thread_start_results ;
664+ int __thread_setup_result = __sync_result ;
665+ if (__thread_setup_result != thrd_success ) {
666+ int __processed_thread_setup_result
667+ = __attr_err_func (__sync_kind , __thread_setup_result , __attr_err_func_arg );
668+ __sync_result = __processed_thread_setup_result ;
668669 // send back the result to the thread so it knows to either go or quit
669670 atomic_store (& __sync_still_ok , false);
670- if (__post_thread_start_results != thrd_success ) {
671+ if (__processed_thread_setup_result != thrd_success ) {
671672 CloseHandle (* __handle );
672673 * __thr = __original_thr ;
673- return __post_thread_start_results ;
674+ return __processed_thread_setup_result ;
674675 }
675676 }
676677 // if all goes well, then we check out origin custom error bit
677678 // invoke our origin custom thread work if possible
678679 if (__custom_on_origin_attr ) {
679- int __custom_err = __custom_on_origin_attr -> func (* __thr , * __ztdc_win32_handle_ptr (__thr ),
680+ int __custom_origin_err = __custom_on_origin_attr -> func (* __thr , * __ztdc_win32_handle_ptr (__thr ),
680681 * __ztdc_win32_handle_id (__thr ), __custom_on_origin_attr -> userdata );
681- if (__custom_err != thrd_success ) {
682- __custom_err = __attr_err_func (__sync_kind , __custom_err , __attr_err_func_arg );
683- __sync_result = __post_thread_start_results ;
682+ if (__custom_origin_err != thrd_success ) {
683+ int __processed_custom_origin_err
684+ = __attr_err_func (__sync_kind , __custom_origin_err , __attr_err_func_arg );
685+ __sync_result = __processed_custom_origin_err ;
684686 // send back the result to the thread so it knows to either go or quit
685687 atomic_store (& __sync_still_ok , false);
686- if (__post_thread_start_results != thrd_success ) {
688+ if (__processed_custom_origin_err != thrd_success ) {
687689 CloseHandle (* __handle );
688690 * __thr = __original_thr ;
689- return __post_thread_start_results ;
691+ return __processed_custom_origin_err ;
690692 }
691693 }
692694 }
0 commit comments