GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: core/src/ux_utility_thread_delete.c Lines: 4 4 100.0 %
Date: 2026-03-06 18:57:10 Branches: 0 0 - %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 * Copyright (c) 2026-present Eclipse ThreadX contributors
4
 *
5
 * This program and the accompanying materials are made available under the
6
 * terms of the MIT License which is available at
7
 * https://opensource.org/licenses/MIT.
8
 *
9
 * SPDX-License-Identifier: MIT
10
 **************************************************************************/
11
12
13
/**************************************************************************/
14
/**************************************************************************/
15
/**                                                                       */
16
/** USBX Component                                                        */
17
/**                                                                       */
18
/**   Utility                                                             */
19
/**                                                                       */
20
/**************************************************************************/
21
/**************************************************************************/
22
23
24
/* Include necessary system files.  */
25
26
#define UX_SOURCE_CODE
27
28
#include "ux_api.h"
29
30
31
#if !defined(UX_STANDALONE)
32
/**************************************************************************/
33
/*                                                                        */
34
/*  FUNCTION                                               RELEASE        */
35
/*                                                                        */
36
/*    _ux_utility_thread_delete                           PORTABLE C      */
37
/*                                                           6.1.11       */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Chaoqiong Xiao, Microsoft Corporation                               */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    This function deletes a thread for USBX.                            */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    thread_ptr                            Thread control block pointer  */
49
/*                                                                        */
50
/*  OUTPUT                                                                */
51
/*                                                                        */
52
/*    Completion Status                                                   */
53
/*                                                                        */
54
/*  CALLS                                                                 */
55
/*                                                                        */
56
/*    tx_thread_terminate                  ThreadX terminate thread       */
57
/*    tx_thread_delete                     ThreadX delete thread service  */
58
/*                                                                        */
59
/*  CALLED BY                                                             */
60
/*                                                                        */
61
/*    USBX Components                                                     */
62
/*                                                                        */
63
/**************************************************************************/
64
529
UINT  _ux_utility_thread_delete(UX_THREAD *thread_ptr)
65
{
66
67
UINT    status;
68
69
70
    /* Call ThreadX to terminate the USBX thread.  */
71
529
    tx_thread_terminate(thread_ptr);
72
73
    /* Call ThreadX to delete the USBX thread.  */
74
529
    status =  tx_thread_delete(thread_ptr);
75
76
    /* Return completion status.  */
77
529
    return(status);
78
}
79
#endif