Line data Source code
1 : /**
2 : * Copyright (c) 2025 Huawei Technologies Co., Ltd.
3 : * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 : * CANN Open Software License Agreement Version 2.0 (the "License").
5 : * Please refer to the License for details. You may not use this file except in compliance with the License.
6 : * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7 : * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 : * See LICENSE in the root of the software repository for the full text of the License.
9 : */
10 : #include "thread.h"
11 : namespace Adx {
12 : /**
13 : * @brief create thread
14 : * @param [out]tid : thread id
15 : * @param [int]funcBlock : function name and parameter
16 : *
17 : * @return
18 : * EN_OK: succ
19 : * other: failed
20 : */
21 1 : int32_t Thread::CreateTask(mmThread &tid, mmUserBlock_t &funcBlock)
22 : {
23 1 : return mmCreateTask(&tid, &funcBlock);
24 : }
25 :
26 : /**
27 : * @brief create thread with detach
28 : * @param [out]tid : thread id
29 : * @param [int]funcBlock : function name and parameter
30 : *
31 : * @return
32 : * EN_OK: succ
33 : * other: failed
34 : */
35 2 : int32_t Thread::CreateDetachTask(mmThread &tid, mmUserBlock_t &funcBlock)
36 : {
37 2 : return mmCreateTaskWithDetach(&tid, &funcBlock);
38 : }
39 : }
|