同步官方代码,除了几个测试用例并无更新

    百图画鸿蒙 + 百文说内核 + 百万注源码  => 挖透鸿蒙内核源码
    鸿蒙研究站 | http://weharmonyos.com (国内)
              | https://weharmony.github.io (国外)
    oschina | https://my.oschina.net/weharmony
    博客园 | https://www.cnblogs.com/weharmony/
    知乎 | https://www.zhihu.com/people/weharmonyos
    csdn | https://blog.csdn.net/kuangyufei
    51cto | https://harmonyos.51cto.com/column/34
    掘金 | https://juejin.cn/user/756888642000808
    公众号 | 鸿蒙研究站 (weharmonyos)
上级 944808f8
此差异已折叠。
......@@ -405,7 +405,7 @@ typedef struct {
UINTPTR userArea; ///< 用户空间的堆区开始位置
UINTPTR userMapBase; ///< 用户空间的栈顶位置,内存来自用户空间,和topOfStack有本质的区别.
UINT32 userMapSize; /**< user thread stack size ,real size : userMapSize + USER_STACK_MIN_SIZE | 用户栈大小 */
FutexNode futex; ///< 快锁节点功能 , 一个任务只能等一把快锁
FutexNode futex; ///< 指明任务在等待哪把快锁,一次只等一锁,锁和任务的关系是(1:N)关系
#endif
UINT32 processID; /**< Which belong process */
LOS_DL_LIST joinList; /**< join list | 联结链表,允许任务之间相互释放彼此 */
......
......@@ -348,7 +348,7 @@ STATIC FutexNode *OsFutexDeleteAlreadyWakeTaskAndGetNext(const FutexNode *node,
return tempNode;
}
/// 插入一把新Futex锁到哈希桶中
/// 插入一把新Futex锁到哈希桶中,只有是新的key时才会插入,因为其实存在多个FutexNode是一个key
STATIC VOID OsFutexInsertNewFutexKeyToHash(FutexNode *node)
{
FutexNode *headNode = NULL;
......
......@@ -46,6 +46,7 @@ static UINT32 testcase(VOID)
s = dcgettext("www.huawei.com", "TestString1\n", LC_MESSAGES);
printf("[INFO]%s:%d,%s,s=%s\n", __FILE__, __LINE__, __func__, s);
ICUNIT_ASSERT_STRING_EQUAL(s, "TestString1\n", s);
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -127,6 +127,7 @@ static UINT32 testcase(VOID)
testcase2();
testcase3();
testcase4();
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -92,6 +92,7 @@ static UINT32 testcase(VOID)
{
testcase1();
testcase2();
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -51,6 +51,7 @@ static UINT32 testcase(VOID)
s = dngettext("www.huawei.com", "TestString1\n", "TestString2\n", 2);
printf("[INFO]%s:%d,%s,s=%s\n", __FILE__, __LINE__, __func__, s);
ICUNIT_ASSERT_STRING_EQUAL(s, "TestString2\n", s);
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -121,6 +121,7 @@ static UINT32 testcase(VOID)
testcase1(); /* test the domain is NULL */
testcase2(); /* test the domain is different with the setlocale */
testcase3(); /* if n != 1,then dngettext will choose msgid2's string */
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -143,6 +143,7 @@ static UINT32 testcase(VOID)
(VOID)RecoveryFileEnv(pathList, 1);
status = WEXITSTATUS(status);
ICUNIT_ASSERT_EQUAL(status, 0, status);
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -56,6 +56,7 @@ static UINT32 testcase1(VOID)
s = gettext("Monday/n\n");
ICUNIT_ASSERT_STRING_EQUAL(s, "Monday/n\n", s);
setlocale(LC_ALL, "C");
return LOS_OK;
OUT:
......
......@@ -58,6 +58,7 @@ static UINT32 testcase(VOID)
strftime(buffer, 80, "%c", timer);
printf("Date is: %s\n", buffer);
ICUNIT_ASSERT_NOT_EQUAL_NULL(buffer, NULL, -1);
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -59,6 +59,7 @@ static UINT32 testcase(VOID)
strftime(buffer, 80, "%c", timer);
printf("Date is: %s\n", buffer);
ICUNIT_ASSERT_NOT_EQUAL_NULL(buffer, NULL, -1);
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -46,6 +46,7 @@ static UINT32 testcase(VOID)
s = ngettext("0123456789", "0123456789", 2);
ICUNIT_ASSERT_STRING_EQUAL(s, "0123456789", s);
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -90,6 +90,7 @@ static UINT32 testcase(VOID)
char *string = nl_langinfo(CRNCYSTR);
ICUNIT_ASSERT_NOT_EQUAL_NULL(string, NULL, string);
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -58,6 +58,7 @@ static UINT32 testcase(VOID) {
char *string = nl_langinfo_l(CRNCYSTR, (locale_t)"zh_CN.UTF-8");
ICUNIT_ASSERT_NOT_EQUAL_NULL(string, NULL, string);
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -69,6 +69,7 @@ static UINT32 testcase1(VOID)
TEST_PRINT("[INFO]%s:%d,%s,ret=%d,buf=%s\n", __FILE__, __LINE__, __func__, ret, buf);
ICUNIT_GOTO_EQUAL(ret, 23, ret, OUT);
ICUNIT_GOTO_EQUAL(errno, 0, errno, OUT);
setlocale(LC_ALL, "C");
return LOS_OK;
OUT:
......
......@@ -129,6 +129,7 @@ static UINT32 testcase(VOID)
testcase2();
testcase3();
testcase4();
setlocale(LC_ALL, "C");
return LOS_OK;
}
......
......@@ -49,6 +49,7 @@ static UINT32 Testcase(VOID)
++result;
}
ICUNIT_GOTO_EQUAL(result, 4, result, EXIT); // 4, except value
setlocale(LC_ALL, "C");
return LOS_OK;
EXIT:
......
......@@ -49,6 +49,7 @@ static UINT32 Testcase(VOID)
len3 = mbrlen(str + 1, sz - 1, &mb);
ICUNIT_GOTO_EQUAL(len3, -1, len3, EXIT);
setlocale(LC_ALL, "C");
return LOS_OK;
EXIT:
......
......@@ -34,6 +34,7 @@ static void *ThreadFuncTest(void *arg)
{
printf("Subthread starting infinite loop\n");
while (1) {
pthread_testcancel();
}
}
......@@ -80,6 +81,9 @@ static int ClockTest(void)
ret = ThreadClock("Subthread CPU time: ", clockid);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
ret = pthread_cancel(thread);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
return 0;
}
......
git add -A
git commit -m ' 围绕FutexNode注解相关逻辑
git commit -m ' 同步官方代码,除了几个测试用例并无更新
百图画鸿蒙 + 百文说内核 + 百万注源码 => 挖透鸿蒙内核源码
鸿蒙研究站 | http://weharmonyos.com (国内)
| https://weharmony.github.io (国外)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册