• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification,
5  * are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright notice, this list of
8  * conditions and the following disclaimer.
9  *
10  * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11  * of conditions and the following disclaimer in the documentation and/or other materials
12  * provided with the distribution.
13  *
14  * 3. Neither the name of the copyright holder nor the names of its contributors may be used
15  * to endorse or promote products derived from this software without specific prior written
16  * permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
22  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #ifndef _IT_POSIX_MUTEX_H
32 #define _IT_POSIX_MUTEX_H
33 
34 #include "osTest.h"
35 #include "pthread.h"
36 #include "errno.h"
37 #include "sched.h"
38 #include "semaphore.h"
39 #include "unistd.h"
40 
41 #define TEST_MUTEX_INIT {0}
42 
43 #define MUTEX_TEST_DEFAULT_PRIO LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO
44 #define MUTEX_TEST_HIGH_PRIO    (MUTEX_TEST_DEFAULT_PRIO - 6)
45 #define MUTEX_TEST_LOW_PRIO     (MUTEX_TEST_DEFAULT_PRIO + 5)
46 
47 UINT32 PosixPthreadDestroy(pthread_attr_t *attr, pthread_t thread);
48 UINT32 PosixPthreadInit(pthread_attr_t *attr, int pri);
49 void TestExtraTaskDelay(UINT32 tick);
50 
51 VOID ItPosixMux001(void);
52 VOID ItPosixMux002(void);
53 VOID ItPosixMux003(void);
54 VOID ItPosixMux004(void);
55 VOID ItPosixMux005(void);
56 VOID ItPosixMux006(void);
57 VOID ItPosixMux007(void);
58 VOID ItPosixMux008(void);
59 VOID ItPosixMux009(void);
60 VOID ItPosixMux010(void);
61 VOID ItPosixMux011(void);
62 VOID ItPosixMux012(void);
63 VOID ItPosixMux013(void);
64 VOID ItPosixMux014(void);
65 VOID ItPosixMux015(void);
66 VOID ItPosixMux016(void);
67 VOID ItPosixMux017(void);
68 VOID ItPosixMux018(void);
69 VOID ItPosixMux019(void);
70 VOID ItPosixMux020(void);
71 VOID ItPosixMux021(void);
72 VOID ItPosixMux022(void);
73 VOID ItPosixMux023(void);
74 VOID ItPosixMux024(void);
75 VOID ItPosixMux025(void);
76 VOID ItPosixMux026(void);
77 VOID ItPosixMux027(void);
78 VOID ItPosixMux028(void);
79 VOID ItPosixMux029(void);
80 VOID ItPosixMux030(void);
81 VOID ItPosixMux031(void);
82 VOID ItPosixMux032(void);
83 VOID ItPosixMux033(void);
84 VOID ItPosixMux034(void);
85 VOID ItPosixMux035(void);
86 VOID ItPosixMux036(void);
87 VOID ItPosixMux037(void);
88 VOID ItPosixMux038(void);
89 VOID ItPosixMux039(void);
90 VOID ItPosixMux040(void);
91 VOID ItPosixMux041(void);
92 VOID ItPosixMux042(void);
93 VOID ItPosixMux043(void);
94 VOID ItPosixMux044(void);
95 VOID ItPosixMux045(void);
96 VOID ItPosixMux046(void);
97 VOID ItPosixMux047(void);
98 VOID ItPosixMux048(void);
99 VOID ItPosixMux049(void);
100 
101 VOID ItSuitePosixMutex(void);
102 
103 #endif
104