From 19e33b74a36cadd5fe8ef5f39e02c82e68291ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=B7=B2=E4=B8=8D=E5=86=8D?= <1513930121@qq.com> Date: Thu, 26 Oct 2023 01:34:22 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=8C=E6=88=90=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 我已不再 <1513930121@qq.com> --- conditional_variable/gjb_S0100901GN_1.c | 69 ++++++++ conditional_variable/gjb_S0100901GN_2.c | 43 +++++ conditional_variable/gjb_S0100901GN_3.c | 81 ++++++++++ conditional_variable/gjb_S0100901GN_4.c | 99 ++++++++++++ conditional_variable/gjb_S0100901GN_5.c | 118 ++++++++++++++ conditional_variable/gjb_S0100901GN_6.c | 76 +++++++++ conditional_variable/gjb_S0100902GN_2.c | 158 +++++++++++++++++++ conditional_variable/gjb_S0100903GN_1.c | 123 +++++++++++++++ conditional_variable/gjb_S0100903GN_2.c | 201 ++++++++++++++++++++++++ conditional_variable/gjb_S0100903GN_3.c | 94 +++++++++++ conditional_variable/gjb_S0100903GN_4.c | 116 ++++++++++++++ conditional_variable/gjb_S0100904GN_1.c | 100 ++++++++++++ conditional_variable/gjb_S0100904GN_2.c | 99 ++++++++++++ conditional_variable/gjb_S0100904GN_3.c | 188 ++++++++++++++++++++++ conditional_variable/gjb_S0100904GN_4.c | 111 +++++++++++++ 15 files changed, 1676 insertions(+) create mode 100644 conditional_variable/gjb_S0100901GN_1.c create mode 100644 conditional_variable/gjb_S0100901GN_2.c create mode 100644 conditional_variable/gjb_S0100901GN_3.c create mode 100644 conditional_variable/gjb_S0100901GN_4.c create mode 100644 conditional_variable/gjb_S0100901GN_5.c create mode 100644 conditional_variable/gjb_S0100901GN_6.c create mode 100644 conditional_variable/gjb_S0100902GN_2.c create mode 100644 conditional_variable/gjb_S0100903GN_1.c create mode 100644 conditional_variable/gjb_S0100903GN_2.c create mode 100644 conditional_variable/gjb_S0100903GN_3.c create mode 100644 conditional_variable/gjb_S0100903GN_4.c create mode 100644 conditional_variable/gjb_S0100904GN_1.c create mode 100644 conditional_variable/gjb_S0100904GN_2.c create mode 100644 conditional_variable/gjb_S0100904GN_3.c create mode 100644 conditional_variable/gjb_S0100904GN_4.c diff --git a/conditional_variable/gjb_S0100901GN_1.c b/conditional_variable/gjb_S0100901GN_1.c new file mode 100644 index 0000000..5b07c9b --- /dev/null +++ b/conditional_variable/gjb_S0100901GN_1.c @@ -0,0 +1,69 @@ +/********************************************************************************************************* +** +** GJB 标准测试集 +** +** Copyright All Rights Reserved +** +**--------------文件信息-------------------------------------------------------------------------------- +** +** 文 件 名: gjb_S0100901GN_1.c +** +** 文件创建日期: 2021 年 1 月 22 日 +** +** 描 述: 初始化、销毁条件变量功能测试 +*********************************************************************************************************/ +#include +#include +#include + +//#include "gjb.h" + +int gjb_S0100901GN_1(int argc, char **argv) +{ + int rc; + + pthread_condattr_t condattr; + pthread_cond_t cond1; + pthread_cond_t cond2; + + /* + * Initialize a condition variable attributes object + */ + if ((rc=pthread_condattr_init(&condattr)) != 0) { + printf("Error at pthread_condattr_init(), rc=%d\n",rc); + goto __errno_handle; + } + + /* + * Initialize cond1 with the default condition variable attributes + */ + if((rc=pthread_cond_init(&cond1,&condattr)) != 0) { + printf("Fail to initialize cond1, rc=%d\n",rc); + printf("Test FAILED\n"); + goto __errno_handle; + } + + /* + * Initialize cond2 with NULL attributes + */ + if((rc=pthread_cond_init(&cond2,NULL)) != 0) { + printf("Fail to initialize cond2, rc=%d\n",rc); + printf("Test FAILED。\n"); + goto __errno_handle; + } + printf("..................................................[(0)]\n \n \n"); + + return (0); + + +__errno_handle: + printf("..................................................[(-1)]\n \n \n"); + return (-1); + + +} + + + + + diff --git a/conditional_variable/gjb_S0100901GN_2.c b/conditional_variable/gjb_S0100901GN_2.c new file mode 100644 index 0000000..250a0d9 --- /dev/null +++ b/conditional_variable/gjb_S0100901GN_2.c @@ -0,0 +1,43 @@ +/********************************************************************************************************* +** +** GJB 标准测试集 +** +** Copyright All Rights Reserved +** +**--------------文件信息-------------------------------------------------------------------------------- +** +** 文 件 名: gjb_S0100901GN_2.c +** +** 文件创建日期: 2021 年 1 月 22 日 +** +** 描 述: 初始化、销毁条件变量功能测试 +*********************************************************************************************************/ +#include +#include +#include + +//#include "gjb.h" + +int gjb_S0100901GN_2(int argc, char **argv) +{ + int rc = 123; + + pthread_condattr_t condattr; + pthread_cond_t cond1; + + /* + * Initialize cond1 with the default condition variable attributes + */ + if ((rc = pthread_cond_init(&cond1,&condattr)) != EINVAL) { + printf("Fail to initialize cond1, rc=%d\n",rc); + printf("Test FAILED\n"); + goto __errno_handle; + } + + printf("..................................................[(0)]\n \n \n"); + + return (0); +__errno_handle: + printf("..................................................[(-1)]\n \n \n"); + return (-1); +} diff --git a/conditional_variable/gjb_S0100901GN_3.c b/conditional_variable/gjb_S0100901GN_3.c new file mode 100644 index 0000000..7b00b09 --- /dev/null +++ b/conditional_variable/gjb_S0100901GN_3.c @@ -0,0 +1,81 @@ +/********************************************************************************************************* +** +** GJB 标准测试集 +** +** Copyright All Rights Reserved +** +**--------------文件信息-------------------------------------------------------------------------------- +** +** 文 件 名: gjb_S0100901GN_3.c +** +** 文件创建日期: 2021 年 1 月 22 日 +** +** 描 述: 初始化、销毁条件变量功能测试 +*********************************************************************************************************/ +#include +#include +#include +#include +#include +//#include "gjb.h" + +#define TEST_UINT_MAX 3100 +pthread_cond_t cond_cv_9013[3100]; + + +int gjb_S0100901GN_3(int argc, char **argv) +{ + int rc; + int i; + + /* + * 初始化cond数组 + */ + memset(cond_cv_9013, 0, 3100*sizeof(pthread_cond_t)); + + for (i = 0; ; i++) { + + /* + * 条件变量初始化 + */ + rc = pthread_cond_init(&(cond_cv_9013[i]),NULL); + + if (rc != 0) { + if (rc == EAGAIN){ + printf("Test pass。 times %d\n",i); + break; + } else{ + printf("test failed.pthread_cond_init should return EAGAIN,but return %d,times %d",rc,i); + for(;i>=0;i--) { + pthread_cond_destroy(&(cond_cv_9013[i])); + } + goto __errno_handle; + } + + } else { + if(i>TEST_UINT_MAX) { + printf("pthread_cond_init sill return successful even i>UINT_MAX,i=%d. test failed.\n",i); + for(;i>=0;i--) { + pthread_cond_destroy(&(cond_cv_9013[i])); + } + goto __errno_handle; + } + } + } + + for(;i>=0;i--) { + if (rc != 0) { + pthread_cond_destroy(&(cond_cv_9013[i])); /* 条件变量的删除 */ + } + } + + printf("..................................................[(0)]\n \n \n"); + + return (0); +__errno_handle: + printf("..................................................[(-1)]\n \n \n"); + return (-1); +} + + + diff --git a/conditional_variable/gjb_S0100901GN_4.c b/conditional_variable/gjb_S0100901GN_4.c new file mode 100644 index 0000000..274222b --- /dev/null +++ b/conditional_variable/gjb_S0100901GN_4.c @@ -0,0 +1,99 @@ +/********************************************************************************************************* +** +** GJB 标准测试集 +** +** Copyright All Rights Reserved +** +**--------------文件信息-------------------------------------------------------------------------------- +** +** 文 件 名: gjb_S0100901GN_4.c +** +** 文件创建日期: 2021 年 1 月 22 日 +** +** 描 述: 初始化、销毁条件变量功能测试 +*********************************************************************************************************/ +#include +#include + +//#include "gjb.h" + +pthread_cond_t cond1_cv_9014, cond2_cv_9014; +pthread_cond_t cond3_cv_9014 = PTHREAD_COND_INITIALIZER; + +int gjb_S0100901GN_4(int argc, char **argv) +{ + int rc; + pthread_condattr_t condattr; + + + /* + * Initialize a condition variable attribute object + */ + if((rc=pthread_condattr_init(&condattr)) != 0) { + printf("Error at pthread_condattr_init(), rc=%d\n",rc); + goto __errno_handle; + } + + /* + * Initialize cond1 with the default condition variable attribute + */ + if((rc=pthread_cond_init(&cond1_cv_9014,&condattr)) != 0) { + printf("Fail to initialize cond1, rc=%d\n",rc); + goto __errno_handle; + } + + /* + * Initialize cond2 with NULL attributes + */ + if((rc=pthread_cond_init(&cond2_cv_9014,NULL)) != 0) { + printf("Fail to initialize cond2, rc=%d\n",rc); + goto __errno_handle; + } + + /* + * Destroy the condition variable attribute object + */ + if((rc=pthread_condattr_destroy(&condattr)) != 0) { + printf("Error at pthread_condattr_destroy(), rc=%d\n",rc); + goto __errno_handle; + } + + /* + * Destroy cond1 + */ + if((rc=pthread_cond_destroy(&cond1_cv_9014)) != 0) { + printf("Fail to destroy cond1, rc=%d\n",rc); + printf("Test FAILED\n"); + goto __errno_handle; + } + + /* + * Destroy cond2 + */ + if((rc=pthread_cond_destroy(&cond2_cv_9014)) != 0) { + printf("Fail to destroy cond2, rc=%d\n",rc); + printf("Test FAILED\n"); + goto __errno_handle; + } + + /* + * Destroy cond3 + */ + if((rc=pthread_cond_destroy(&cond3_cv_9014)) != 0) { + printf("Fail to destroy cond3, rc=%d\n",rc); + printf("Test FAILED\n"); + goto __errno_handle; + } + + printf("..................................................[(0)]\n \n \n"); + + return (0); + +__errno_handle: + printf("..................................................[(-1)]\n \n \n"); + return (-1); +} + + + + diff --git a/conditional_variable/gjb_S0100901GN_5.c b/conditional_variable/gjb_S0100901GN_5.c new file mode 100644 index 0000000..1f48df8 --- /dev/null +++ b/conditional_variable/gjb_S0100901GN_5.c @@ -0,0 +1,118 @@ +/********************************************************************************************************* +** +** GJB 标准测试集 +** +** Copyright All Rights Reserved +** +**--------------文件信息-------------------------------------------------------------------------------- +** +** 文 件 名: gjb_S0100901GN_5.c +** +** 文件创建日期: 2021 年 1 月 22 日 +** +** 描 述: 初始化、销毁条件变量功能测试 +*********************************************************************************************************/ +#define __SYLIXOS_KERNEL +#include +#include +#include +#include +#include +#include + +//#include "gjb.h" + +#define TEST "-2" +#define FUNCTION "pthread_cond_destroy" +#define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " + +static int err_count_cv_9015; +/* cond used by the two threads */ +pthread_cond_t cond_cv_9015 = PTHREAD_COND_INITIALIZER; + +/* cond used by the two threads */ +pthread_mutex_t mutex_cv_9015 = PTHREAD_MUTEX_INITIALIZER; + +void * thread_cv_9015(void *tmp) +{ + int rc = 0; + + /* + * acquire the mutex + */ + rc = pthread_mutex_lock(&mutex_cv_9015); + if(rc != 0) { + printf(ERROR_PREFIX "pthread_mutex_lock\n"); + err_count_cv_9015++; + return (void *)-1; + } + + /* + * Wait on the cond var. This will not return, as nobody signals + */ + rc = pthread_cond_wait(&cond_cv_9015, &mutex_cv_9015); + if(rc != 0) { + printf(ERROR_PREFIX "pthread_cond_wait\n"); + err_count_cv_9015++; + return (void *)-1; + } + + rc = pthread_mutex_unlock(&mutex_cv_9015); + if(rc != 0) { + printf(ERROR_PREFIX "pthread_mutex_unlock\n"); + err_count_cv_9015++; + return (void *)-1; + } + + return NULL; +} + +int gjb_S0100901GN_5(int argc, char **argv) +{ + pthread_t low_id; + int rc = 0; + + /* + * Create a new thread with default attributes + */ + rc = pthread_create(&low_id, NULL, thread_cv_9015, NULL); + if(rc != 0) { + printf(ERROR_PREFIX "pthread_create\n"); + goto __errno_handle; + } + + /* + * Let the other thread run + */ + sleep(5); + + + /* + * Try to destroy the cond var. This should return an error + */ + rc = pthread_cond_destroy(&cond_cv_9015); + if(rc != EBUSY) { + printf(ERROR_PREFIX "Test failed: Expected %d(EBUSY) got %d.\n", EBUSY, rc); + goto __errno_handle; + } + + //GJB_PRT_INFO("Test PASS\n"); + printf("Test PASS\n"); + + rc = pthread_cond_signal(&cond_cv_9015); + if(rc != 0) { + printf("pthread_cond_signal\n"); + goto __errno_handle; + } + + if (err_count_cv_9015) { + goto __errno_handle; + } + printf("..................................................[(0)]\n \n \n"); + + return (0); + +__errno_handle: + printf("..................................................[(-1)]\n \n \n"); + return (-1); +} diff --git a/conditional_variable/gjb_S0100901GN_6.c b/conditional_variable/gjb_S0100901GN_6.c new file mode 100644 index 0000000..01ca189 --- /dev/null +++ b/conditional_variable/gjb_S0100901GN_6.c @@ -0,0 +1,76 @@ +/********************************************************************************************************* +** +** GJB 标准测试集 +** +** Copyright All Rights Reserved +** +**--------------文件信息-------------------------------------------------------------------------------- +** +** 文 件 名: gjb_S0100901GN_6.c +** +** 文件创建日期: 2021 年 1 月 22 日 +** +** 描 述: 初始化、销毁条件变量功能测试 +*********************************************************************************************************/ +#include +#include +#include +#include +#include + +//#include "gjb.h" + +int gjb_S0100901GN_6(int argc, char **argv) +{ + + pthread_cond_t cond; + int rc; + + /* + * Initialize cond2 with NULL attributes + */ + if((rc=pthread_cond_init(&cond,NULL)) != 0) { + printf("Fail to initialize cond, rc=%d\n",rc); + goto __errno_handle; + } + + if(pthread_cond_destroy(&cond) != 0) { + printf("Fail to destroy cond\n"); + printf("Test FAILED\n"); + + goto __errno_handle; + } + + /* + * Try to destroy a NULL condition variable attributes object using pthread_cond_destroy() + * It should return EINVAL + */ + if((rc=pthread_cond_destroy(&cond)) == EINVAL) { + printf("Test PASSED\n"); + + } else { + printf("Test FAILED: *NOTE: Expect %d(EINVAL), but return %d.\n", EINVAL, rc); + goto __errno_handle; + } + + + if((rc=pthread_cond_destroy(NULL)) == EINVAL) { + printf("Test PASSED when para is null.\n"); + + } else { + printf("Test FAILED: when para is null.*NOTE: Expect %d(EINVAL), but return %d.\n", EINVAL, rc); + goto __errno_handle; + } + + printf("..................................................[(0)]\n \n \n"); + + return (0); + +__errno_handle: + printf("..................................................[(-1)]\n \n \n"); + return (-1); +} + + + + diff --git a/conditional_variable/gjb_S0100902GN_2.c b/conditional_variable/gjb_S0100902GN_2.c new file mode 100644 index 0000000..fa871fb --- /dev/null +++ b/conditional_variable/gjb_S0100902GN_2.c @@ -0,0 +1,158 @@ +/********************************************************************************************************* +** +** GJB 标准测试集 +** +** Copyright All Rights Reserved +** +**--------------文件信息-------------------------------------------------------------------------------- +** +** 文 件 名: gjb_S0100902GN_1.c +** +** 文件创建日期: 2021 年 1 月 22 日 +** +** 描 述: 以永久阻塞方式等待条件变量功能测试 +*********************************************************************************************************/ +#include +#include +#include +#include +#include +#include + +//#include "gjb.h" + +static int err_count_cv_9022; + +pthread_cond_t cond1_cv_9022 = PTHREAD_COND_INITIALIZER; /* cond used by the two threads */ + +pthread_mutex_t mutex1_cv_9022 = PTHREAD_MUTEX_INITIALIZER; /* cond used by the two threads */ + +void * thread1_cv_9022(void *tmp) +{ + int rc = 0; + + /* + * acquire the mutex + */ + rc = pthread_mutex_lock(&mutex1_cv_9022); + if(rc != 0) { + printf("test failed.pthread_mutex_lock\n"); + err_count_cv_9022++; + return (void *)-1; + } + + + rc = pthread_cond_wait(&cond1_cv_9022, &cond1_cv_9022); + if (rc == EINVAL) { + printf("test 2 pass,pthread_cond_wait return EINVAL \n"); + + } else { + printf("test 2 failed.pthread_cond_wait should return EINVAL , but return %d\n",rc); + err_count_cv_9022++; + return (void *)-1; + } + + rc = pthread_cond_wait(NULL, &mutex1_cv_9022); + if (rc == EINVAL ) { + printf("test 3 pass,pthread_cond_wait return EINVAL \n"); + + } else { + printf("test 3 failed.pthread_cond_wait should return EINVAL , but return %d\n",rc); + err_count_cv_9022++; + return (void *)-1; + } + + rc = pthread_cond_wait(&cond1_cv_9022,NULL); + if(rc == EINVAL ) { + printf("test 4 pass,pthread_cond_wait return EINVAL \n"); + + } else { + printf("test 4 failed.pthread_cond_wait should return EINVAL , but return %d\n",rc); + err_count_cv_9022++; + return (void *)-1; + } + + rc = pthread_cond_wait(&cond1_cv_9022,&mutex1_cv_9022); + if(rc != 0 ) { + printf("test 5 failed.pthread_cond_wait should return 0 , but return %d\n",rc); + err_count_cv_9022++; + return (void *)-1; + } + + rc = pthread_mutex_unlock(&mutex1_cv_9022); + if(rc != 0) { + printf("test failed.pthread_mutex_unlock\n"); + err_count_cv_9022++; + return (void *)-1; + } + + return NULL; +} + +int gjb_S0100902GN_2(int argc, char **argv) +{ + pthread_t low_id; + pthread_mutex_t mutex2; + int rc = 0; + + pthread_mutex_init(&mutex2,NULL); + + /* + * Create a new thread with default attributes + */ + rc = pthread_create(&low_id, NULL, thread1_cv_9022, NULL); + if(rc != 0) { + printf("pthread_create\n"); + goto __errno_handle; + } + + /* + * Let the other thread run + */ + sleep(2); + + /* + * acquire the mutex + */ + rc = pthread_mutex_lock(&mutex2); + if(rc != 0) { + printf("test failed.pthread_mutex_lock(2)\n"); + goto __errno_handle; + } + + rc = pthread_cond_wait(&cond1_cv_9022,&mutex2); + if(rc == EINVAL ) { + printf("test 5 pass,pthread_cond_wait return EINVAL \n"); + + } else { + printf("test 5 failed.pthread_cond_wait should return EINVAL , but return %d\n",rc); + goto __errno_handle; + } + + rc = pthread_mutex_unlock(&mutex2); + if(rc != 0) { + printf("test failed.pthread_mutex_unlock\n"); + goto __errno_handle; + } + + + + sleep(1); + pthread_kill(low_id, SIGTERM); + + if (err_count_cv_9022) { + goto __errno_handle; + } + + printf("..................................................[(0)]\n \n \n"); + + return (0); + +__errno_handle: + printf("..................................................[(-1)]\n \n \n"); + return (-1); +} + + + + diff --git a/conditional_variable/gjb_S0100903GN_1.c b/conditional_variable/gjb_S0100903GN_1.c new file mode 100644 index 0000000..660c4a6 --- /dev/null +++ b/conditional_variable/gjb_S0100903GN_1.c @@ -0,0 +1,123 @@ +/********************************************************************************************************* +** +** GJB 标准测试集 +** +** Copyright All Rights Reserved +** +**--------------文件信息-------------------------------------------------------------------------------- +** +** 文 件 名: gjb_S0100903GN_1.c +** +** 文件创建日期: 2021 年 1 月 22 日 +** +** 描 述: 以限时阻塞方式等待条件变量功能测试 +*********************************************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// #include +// #include +// #include + +// #include "gjb.h" + +#define TIMEOUT 5 + +static int err_count_cv_9031; + +pthread_cond_t cond_cv_9031 = PTHREAD_COND_INITIALIZER; /* cond used by the two threads */ + +pthread_mutex_t mutex_cv_9031 = PTHREAD_MUTEX_INITIALIZER; /* cond used by the two threads */ + +void * thread_cv_9031(void *tmp) +{ + int rc = 0; + struct timespec timeout; + struct timespec curtime; + + /* + * acquire the mutex + */ + rc = pthread_mutex_lock(&mutex_cv_9031); + if(rc != 0) { + printf("test failed.pthread_mutex_lock\n"); + err_count_cv_9031++; + return (void *)-1; + } + + + if (clock_gettime(CLOCK_REALTIME, &curtime) != 0) { + printf("Fail to get current time\n"); + err_count_cv_9031++; + return (void *)-1; + } + + timeout.tv_sec = curtime.tv_sec; + + timeout.tv_nsec = curtime.tv_nsec; + + timeout.tv_sec += TIMEOUT; + + rc = pthread_cond_timedwait(&cond_cv_9031, &mutex_cv_9031, &timeout); + if(rc == 0) { + printf("test pass.pthread_cond_timedwait return 0\n"); + + } else { + printf("test failed,pthread_cond_timedwait return %d",rc); + err_count_cv_9031++; + return (void *)-1; + } + + rc = pthread_mutex_unlock(&mutex_cv_9031); + if(rc != 0) { + printf("test failed.pthread_mutex_unlock\n"); + err_count_cv_9031++; + return (void *)-1; + } + + return NULL; +} + +int gjb_S0100903GN_1(int argc, char **argv) +{ + pthread_t low_id; + int rc = 0; + + /* + * Create a new thread with default attributes + */ + rc = pthread_create(&low_id, NULL, thread_cv_9031, NULL); + if(rc != 0) { + printf("pthread_create\n"); + goto __errno_handle; + } + + /* + * Let the other thread run + */ + sleep(2); + + pthread_cond_signal(&cond_cv_9031); + + if (err_count_cv_9031) { + goto __errno_handle; + } + + printf("..................................................[(0)]\n \n \n"); + + return (0); + +__errno_handle: + printf("..................................................[(-1)]\n \n \n"); + return (-1); + +} diff --git a/conditional_variable/gjb_S0100903GN_2.c b/conditional_variable/gjb_S0100903GN_2.c new file mode 100644 index 0000000..c4d84c7 --- /dev/null +++ b/conditional_variable/gjb_S0100903GN_2.c @@ -0,0 +1,201 @@ +/********************************************************************************************************* +** +** GJB 标准测试集 +** +** Copyright All Rights Reserved +** +**--------------文件信息-------------------------------------------------------------------------------- +** +** 文 件 名: gjb_S0100903GN_2.c +** +** 文件创建日期: 2021 年 1 月 22 日 +** +** 描 述: 以限时阻塞方式等待条件变量功能测试 +*********************************************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// #include "gjb.h" + +#define TIMEOUT 5 + +static int err_count_cv_9032; + +pthread_cond_t cond1_cv_9032 = PTHREAD_COND_INITIALIZER; /* cond used by the two threads */ +pthread_mutex_t mutex1_cv_9032 = PTHREAD_MUTEX_INITIALIZER; /* cond used by the two threads */ + +void * thread1_cv_9032(void *tmp) +{ + int rc = 0; + struct timespec timeout; + struct timespec curtime; + + /* + * acquire the mutex + */ + rc = pthread_mutex_lock(&mutex1_cv_9032); + if(rc != 0) { + printf("test failed.pthread_mutex_lock\n"); + err_count_cv_9032++; + return (void *)-1; + } + + if (clock_gettime(CLOCK_REALTIME, &curtime) != 0) { + printf("Fail to get current time\n"); + err_count_cv_9032++; + return (void *)-1; + } + + timeout.tv_sec = curtime.tv_sec; + + timeout.tv_nsec = curtime.tv_nsec; + + timeout.tv_sec += TIMEOUT; + + /* + * 传入无效的参数类型 + */ + rc = pthread_cond_timedwait(&mutex1_cv_9032, &mutex1_cv_9032, &timeout); + if(rc == EINVAL ) { + printf("test 1 pass,pthread_cond_timedwait return EINVAL \n"); + + } else { + printf("test 1 failed.pthread_cond_timedwait should return EINVAL , but return %d\n",rc); + err_count_cv_9032++; + return (void *)-1; + } + + /* + * 传入无效的参数类型 + */ + rc = pthread_cond_timedwait(&cond1_cv_9032, &cond1_cv_9032 , &timeout); + if(rc == EINVAL ) { + printf("test 2 pass,pthread_cond_timedwait return EINVAL \n"); + + } else { + printf("test 2 failed.pthread_cond_timedwait should return EINVAL , but return %d\n",rc); + err_count_cv_9032++; + return (void *)-1; + } + + rc = pthread_cond_timedwait(NULL, &mutex1_cv_9032, &timeout); + if(rc == EINVAL ) { + printf("test 3 pass,pthread_cond_timedwait return EINVAL \n"); + + } else { + printf("test 3 failed.pthread_cond_timedwait should return EINVAL , but return %d\n",rc); + err_count_cv_9032++; + return (void *)-1; + } + + rc = pthread_cond_timedwait(&cond1_cv_9032, NULL, &timeout); + if(rc == EINVAL ) { + printf("test 4 pass,pthread_cond_timedwait return EINVAL \n"); + + } else { + printf("test 4 failed.pthread_cond_timedwait should return EINVAL , but return %d\n",rc); + err_count_cv_9032++; + return (void *)-1; + } + + rc = pthread_cond_timedwait(&cond1_cv_9032, &mutex1_cv_9032, &timeout); + if(rc != 0 ) { + printf("test failed.pthread_cond_timedwait should return 0 , but return %d\n",rc); + err_count_cv_9032++; + return (void *)-1; + } + + rc = pthread_mutex_unlock(&mutex1_cv_9032); + if(rc != 0) { + printf("test failed.pthread_mutex_unlock\n"); + err_count_cv_9032++; + return (void *)-1; + } + sleep(2); + + pthread_cond_signal(&cond1_cv_9032); + + return NULL; +} + +int gjb_S0100903GN_2(int argc, char **argv) +{ + pthread_t low_id; + pthread_mutex_t mutex2; + struct timespec timeout; + + struct timespec curtime; + int rc = 0; + + pthread_mutex_init(&mutex2,NULL); + + /* + * Create a new thread with default attributes + */ + rc = pthread_create(&low_id, NULL, thread1_cv_9032, NULL); + if(rc != 0) { + printf("pthread_create\n"); + goto __errno_handle; + } + + /* + * Let the other thread run + */ + sleep(3); + + pthread_cond_signal(&cond1_cv_9032); + + if (clock_gettime(CLOCK_REALTIME, &curtime) != 0) { + printf("Fail to get current time\n"); + goto __errno_handle; + } + + timeout.tv_sec = curtime.tv_sec; + + timeout.tv_nsec = curtime.tv_nsec; + + timeout.tv_sec += TIMEOUT; + + rc = pthread_mutex_lock(&mutex2); + if(rc != 0) { + printf("test failed.pthread_mutex_lock\n"); + goto __errno_handle; + } + + rc = pthread_cond_timedwait(&cond1_cv_9032, &mutex2, &timeout); + if(rc == EINVAL ) { + printf("test 5 pass,pthread_cond_timedwait return EINVAL \n"); + + } else { + printf("test 5 failed.pthread_cond_timedwait should return EINVAL , but return %d\n",rc); + goto __errno_handle; + } + + rc = pthread_mutex_unlock(&mutex2); + if(rc != 0) { + printf("test failed.pthread_mutex_unlock\n"); + goto __errno_handle; + } + + if (err_count_cv_9032) { + goto __errno_handle; + } + + printf("..................................................[(0)]\n \n \n"); + + return (0); + +__errno_handle: + + printf("..................................................[(-1)]\n \n \n"); + return (-1); +} diff --git a/conditional_variable/gjb_S0100903GN_3.c b/conditional_variable/gjb_S0100903GN_3.c new file mode 100644 index 0000000..cadd762 --- /dev/null +++ b/conditional_variable/gjb_S0100903GN_3.c @@ -0,0 +1,94 @@ +/********************************************************************************************************* +** +** GJB 标准测试集 +** +** Copyright All Rights Reserved +** +**--------------文件信息-------------------------------------------------------------------------------- +** +** 文 件 名: gjb_S0100903GN_3.c +** +** 文件创建日期: 2021 年 1 月 22 日 +** +** 描 述: 以限时阻塞方式等待条件变量功能测试 +*********************************************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//#include "gjb.h" + +#define TIMEOUT 5 + +static int err_count_cv_9033 = 0; +pthread_cond_t cond2_cv_9033 = PTHREAD_COND_INITIALIZER; /* cond used by the two threads */ +pthread_mutex_t mutex3_cv_9033 = PTHREAD_MUTEX_INITIALIZER; /* cond used by the two threads */ + +void * thread2_cv_9033 (void *tmp) +{ + int rc = 0; + struct timespec timeout; + struct timespec curtime; + + if (clock_gettime(CLOCK_REALTIME, &curtime) != 0) { + printf("Fail to get current time\n"); + return (void *)-1; + } + + timeout.tv_sec = curtime.tv_sec; + + timeout.tv_nsec = curtime.tv_nsec; + + timeout.tv_sec += TIMEOUT; + + rc = pthread_cond_timedwait(&cond2_cv_9033, &mutex3_cv_9033, &timeout); + if (rc == EPERM) { + printf("test pass.pthread_cond_timedwait return EPERM \n"); + } else { + printf("test failed.pthread_cond_timedwait should return EPERM , but return %d\n",rc); + err_count_cv_9033++; + return (void *)-1; + } + + return NULL; +} + +int gjb_S0100903GN_3(int argc, char **argv) +{ + pthread_t low_id; + int rc = 0; + + /* + * Create a new thread with default attributes + */ + rc = pthread_create(&low_id, NULL, thread2_cv_9033, NULL); + if (rc != 0) { + printf("pthread_create\n"); + goto __errno_handle; + } + + /* + * Let the other thread run + */ + sleep(2); + + if (err_count_cv_9033) { + goto __errno_handle; + } + + printf("..................................................[(0)]\n \n \n"); + + return (0); + +__errno_handle: + printf("..................................................[(-1)]\n \n \n"); + return (-1); +} diff --git a/conditional_variable/gjb_S0100903GN_4.c b/conditional_variable/gjb_S0100903GN_4.c new file mode 100644 index 0000000..0179e95 --- /dev/null +++ b/conditional_variable/gjb_S0100903GN_4.c @@ -0,0 +1,116 @@ +/********************************************************************************************************* +** +** GJB 标准测试集 +** +** Copyright All Rights Reserved +** +**--------------文件信息-------------------------------------------------------------------------------- +** +** 文 件 名: gjb_S0100903GN_4.c +** +** 文件创建日期: 2021 年 1 月 22 日 +** +** 描 述: 以限时阻塞方式等待条件变量功能测试 +*********************************************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// #include "gjb.h" + +#define TIMEOUT 5 + + +static int err_count_cv_9034; + +pthread_cond_t cond3_cv_9034 = PTHREAD_COND_INITIALIZER; /* cond used by the two threads */ + +pthread_mutex_t mutex4_cv_9034 = PTHREAD_MUTEX_INITIALIZER; /* cond used by the two threads */ + +void * thread3_cv_9034(void *tmp) +{ + int rc = 0; + struct timespec timeout; + struct timespec curtime; + + /* + * acquire the mutex + */ + rc = pthread_mutex_lock(&mutex4_cv_9034); + if(rc != 0) { + printf("test failed.pthread_mutex_lock\n"); + err_count_cv_9034++; + return (void *)-1; + } + + if (clock_gettime(CLOCK_REALTIME, &curtime) != 0) { + printf("Fail to get current time\n"); + err_count_cv_9034++; + return (void *)-1; + } + + timeout.tv_sec = curtime.tv_sec; + + timeout.tv_nsec = curtime.tv_nsec; + + timeout.tv_sec += TIMEOUT; + + + rc = pthread_cond_timedwait(&cond3_cv_9034, &mutex4_cv_9034, &timeout); + if(rc == ETIMEDOUT) { + printf("test pass.pthread_cond_timedwait returned ETIMEDOUT\n"); + + } else { + printf("test failed.pthread_cond_timedwait should return ETIMEDOUT ,but return %d\n",rc); + err_count_cv_9034++; + return (void *)-1; + } + + rc = pthread_mutex_unlock(&mutex4_cv_9034); + if(rc != 0) { + printf("test failed.pthread_mutex_unlock\n"); + err_count_cv_9034++; + return (void *)-1; + } + + return NULL; +} + +int gjb_S0100903GN_4(int argc, char **argv) +{ + pthread_t low_id; + int rc = 0; + + /* + * Create a new thread with default attributes + */ + rc = pthread_create(&low_id, NULL, thread3_cv_9034, NULL); + if(rc != 0) { + printf("pthread_create\n"); + goto __errno_handle; + } + + /* + * Let the other thread run + */ + sleep(10); + + if (err_count_cv_9034) { + goto __errno_handle; + } + printf("..................................................[(0)]\n \n \n"); + + return (0); + +__errno_handle: + printf("..................................................[(-1)]\n \n \n"); + return (-1); +} diff --git a/conditional_variable/gjb_S0100904GN_1.c b/conditional_variable/gjb_S0100904GN_1.c new file mode 100644 index 0000000..a71f14f --- /dev/null +++ b/conditional_variable/gjb_S0100904GN_1.c @@ -0,0 +1,100 @@ +/********************************************************************************************************* +** +** GJB 标准测试集 +** +** Copyright All Rights Reserved +** +**--------------文件信息-------------------------------------------------------------------------------- +** +** 文 件 名: gjb_S0100904GN_1.c +** +** 文件创建日期: 2021 年 1 月 22 日 +** +** 描 述: 使用条件变量同时唤醒一个或者多个等待任务/进程功能测试 +*********************************************************************************************************/ +#include +#include +#include +#include +#include + +// #include "gjb.h" + +static int err_count_cv_9041; +pthread_cond_t cond_cv_9041 = PTHREAD_COND_INITIALIZER; /* cond used by the two threads */ +pthread_mutex_t mutex_cv_9041 = PTHREAD_MUTEX_INITIALIZER; /* cond used by the two threads */ + +void * thread_cv_9041 (void *tmp) +{ + int rc = 0; + + /* + * acquire the mutex + */ + rc = pthread_mutex_lock(&mutex_cv_9041); + if (rc != 0) { + printf("test failed.pthread_mutex_lock\n"); + err_count_cv_9041++; + return (void *)-1; + } + + /* + * Wait on the cond var. This will not return, as nobody signals + */ + rc = pthread_cond_wait(&cond_cv_9041, &mutex_cv_9041); + if (rc != 0) { + printf("test failed.pthread_cond_wait\n"); + err_count_cv_9041++; + return (void *)-1; + } + + rc = pthread_mutex_unlock(&mutex_cv_9041); + if (rc != 0) { + printf("test failed.pthread_mutex_unlock\n"); + err_count_cv_9041++; + return (void *)-1; + } + + return NULL; +} + +int gjb_S0100904GN_1(int argc, char **argv) +{ + pthread_t low_id; + int rc = 0; + + /* + * Create a new thread with default attributes + */ + rc = pthread_create(&low_id, NULL, thread_cv_9041, NULL); + if (rc != 0) { + printf("pthread_create\n"); + goto __errno_handle; + } + + /* + * Let the other thread run + */ + sleep(2); + + rc = pthread_cond_signal(&cond_cv_9041); + if (rc==0) { + printf("test pass.pthread_cond_signal return 0\n"); + + } else { + printf("test failed:pthread_cond_signal should return 0,but return %d",rc); + goto __errno_handle; + } + + if (err_count_cv_9041) { + goto __errno_handle; + } + + printf("..................................................[(0)]\n \n \n"); + + return (0); + +__errno_handle: + printf("..................................................[(-1)]\n \n \n"); + return (-1); +} diff --git a/conditional_variable/gjb_S0100904GN_2.c b/conditional_variable/gjb_S0100904GN_2.c new file mode 100644 index 0000000..c4fe601 --- /dev/null +++ b/conditional_variable/gjb_S0100904GN_2.c @@ -0,0 +1,99 @@ +/********************************************************************************************************* +** +** GJB 标准测试集 +** +** Copyright All Rights Reserved +** +**--------------文件信息-------------------------------------------------------------------------------- +** +** 文 件 名: gjb_S0100904GN_2.c +** +** 文件创建日期: 2021 年 1 月 22 日 +** +** 描 述: 使用条件变量同时唤醒一个或者多个等待任务/进程功能测试 +*********************************************************************************************************/ +#include +#include +#include +#include +#include + +// #include "gjb.h" + +// int gjb_S0100904GN_2(int argc, char **argv) +int main(int argc, char **argv) +{ + pthread_condattr_t condattr; + pthread_cond_t cond; + int rc,fail=0; + + /* + * Initialize a condition variable attribute object + */ + if ((rc = pthread_condattr_init(&condattr)) != 0) { + printf("Error at pthread_condattr_init(), rc=%d\n",rc); + goto __errno_handle; + } + + /* + * Initialize cond with the default condition variable attribute + */ + if ((rc = pthread_cond_init(&cond,&condattr)) != 0) { + printf("Fail to initialize cond, rc=%d\n",rc); + goto __errno_handle; + } + + /* + * Destroy the condition variable attribute object + */ + if ((rc = pthread_condattr_destroy(&condattr)) != 0) { + printf("Error at pthread_condattr_destroy(), rc=%d\n",rc); + goto __errno_handle; + } + + /* + * Destroy cond + */ + if ((rc = pthread_cond_destroy(&cond)) != 0) { + printf("Fail to destroy cond, rc=%d\n",rc); + printf("Test FAILED\n"); + + goto __errno_handle; + } + + rc = pthread_cond_signal(&cond); + if (rc == EINVAL) { + printf("test pass when the cond is not exist .pthread_cond_signal return EINVAL\n"); + + } else { + printf("test failed when the cond is not exist.pthread_cond_signal should return EINVAL,but return %d\n",rc); + fail = 1; + } + + + rc = pthread_cond_signal(NULL); + if (rc == EINVAL) { + printf("test NULL pass.pthread_cond_signal return EINVAL\n"); + + } else { + printf("test failed:pthread_cond_signal should return EINVAL,but return %d",rc); + fail = 1; + } + + if (fail == 1) { + printf("Test failed.\n"); + goto __errno_handle; + + } else { + printf("Test pass\n"); + } + + printf("..................................................[(0)]\n \n \n"); + + return (0); + +__errno_handle: + printf("..................................................[(-1)]\n \n \n"); + return (-1); + +} diff --git a/conditional_variable/gjb_S0100904GN_3.c b/conditional_variable/gjb_S0100904GN_3.c new file mode 100644 index 0000000..3d504b1 --- /dev/null +++ b/conditional_variable/gjb_S0100904GN_3.c @@ -0,0 +1,188 @@ +/********************************************************************************************************* +** +** GJB 标准测试集 +** +** Copyright All Rights Reserved +** +**--------------文件信息-------------------------------------------------------------------------------- +** +** 文 件 名: gjb_S0100904GN_3.c +** +** 文件创建日期: 2021 年 1 月 22 日 +** +** 描 述: 使用条件变量同时唤醒一个或者多个等待任务/进程功能测试 +*********************************************************************************************************/ +#include +#include +#include +#include +#include + +// #include "gjb.h" + +static int err_count_cv_9043 = 0; +static pthread_cond_t cond_cv_9043 = PTHREAD_COND_INITIALIZER; /* cond used by the two threads */ +static pthread_mutex_t mutex_cv_9043; //= PTHREAD_MUTEX_INITIALIZER; /* cond used by the two threads */ + +void * thread_cv_9043 (void *tmp) +{ + int rc = 0; + + /* + * acquire the mutex + */ + rc = pthread_mutex_lock(&mutex_cv_9043); + if (rc != 0) { + printf("test failed.pthread_mutex_lock\n"); + err_count_cv_9043++; + return (void *)-1; + } + + /* + * Wait on the cond var. This will not return, as nobody signals + */ + rc = pthread_cond_wait(&cond_cv_9043, &mutex_cv_9043); + if (rc != 0) { + printf("test 1.1 failed.pthread_cond_wait\n"); + err_count_cv_9043++; + return (void *)-1; + } + + rc = pthread_cond_wait(&cond_cv_9043, &mutex_cv_9043); + if (rc != 0) { + printf("test 1.2 failed.pthread_cond_wait\n,should return 0,but return %d\n",rc); + err_count_cv_9043++; + return (void *)-1; + } + + rc = pthread_mutex_unlock(&mutex_cv_9043); + if (rc != 0) { + printf("test failed.pthread_mutex_unlock\n"); + err_count_cv_9043++; + return (void *)-1; + } + + return NULL; +} + +void * thread1_cv_9043(void *tmp) +{ + int rc = 0; + + /* + * acquire the mutex + */ + rc = pthread_mutex_lock(&mutex_cv_9043/*&mutex1*/); + if(rc != 0) { + printf("test failed.pthread_mutex_lock(1)\n"); + err_count_cv_9043++; + return (void *)-1; + } + + /* + * Wait on the cond var. This will not return, as nobody signals* + */ + rc = pthread_cond_wait(&cond_cv_9043, &mutex_cv_9043/*&mutex1*/); + if(rc != 0) { + printf( "test 2.1 failed.pthread_cond_wait, rc = %d\n",rc); + err_count_cv_9043++; + return (void *)-1; + } + + rc = pthread_cond_wait(&cond_cv_9043, &mutex_cv_9043/*&mutex1*/); + if (rc != 0) { + printf( "test 2.2 failed.pthread_cond_wait\n,should return 0,but return %d\n",rc); + err_count_cv_9043++; + return (void *)-1; + } + + rc = pthread_mutex_unlock(&mutex_cv_9043); + if(rc != 0) { + printf( "test failed.pthread_mutex_unlock\n"); + err_count_cv_9043++; + return (void *)-1; + } + + return NULL; +} + +int gjb_S0100904GN_3(int argc, char **argv) +{ + pthread_t low_id,low_id1; + int rc = 0; + + if (pthread_mutex_init(&mutex_cv_9043, NULL) != 0) { + printf("Fail to initialize mutex\n"); + goto __errno_handle; + } + + /* + * Create a new thread with default attributes + */ + rc = pthread_create(&low_id, NULL, thread_cv_9043, NULL); + if (rc != 0) { + printf( "pthread_create\n"); + goto __errno_handle; + } + + rc = pthread_create(&low_id1, NULL, thread1_cv_9043, NULL); + if (rc != 0) { + printf( "pthread_create\n"); + goto __errno_handle; + } + + /* + * Let the other thread run + */ + sleep(2); + + rc = pthread_cond_broadcast(&cond_cv_9043); + if (rc == 0) { + printf( "1.1test pass.pthread_cond_broadcast return 0\n"); + + } else { + printf("1.1test failed:pthread_cond_broadcast should return 0,but return %d\n",rc); + goto __errno_handle; + } + + sleep(1); + rc = pthread_cond_broadcast(&cond_cv_9043); + if (rc == 0) { + printf( "1.2test pass.pthread_cond_broadcast return 0\n"); + + } else { + printf("1.2test failed:pthread_cond_broadcast should return 0,but return %d\n",rc); + goto __errno_handle; + } + + sleep(1); + + /* + * Try to destroy the cond var. This should return 0 + * because pthread_cond_broadcast should exit all the pthread_cond_wait + */ + rc = pthread_cond_destroy(&cond_cv_9043); + if (rc == 0) { + printf( "Test pass. pthread_cond_destroy should return 0\n"); + } else { + printf ("Test failed. pthread_cond_destroy should return 0,but return %d\n",rc); + goto __errno_handle; + } + + if (pthread_mutex_destroy(&mutex_cv_9043) != 0) { + printf("Fail to pthread_mutex_destroy mutex\n"); + goto __errno_handle; + } + + if (err_count_cv_9043) { + goto __errno_handle; + } + + printf("..................................................[(0)]\n \n \n"); + + return (0); + +__errno_handle: + printf("..................................................[(-1)]\n \n \n"); + return (-1); +} diff --git a/conditional_variable/gjb_S0100904GN_4.c b/conditional_variable/gjb_S0100904GN_4.c new file mode 100644 index 0000000..1db9ebf --- /dev/null +++ b/conditional_variable/gjb_S0100904GN_4.c @@ -0,0 +1,111 @@ +/********************************************************************************************************* +** +** GJB ��׼���Լ� +** +** Copyright All Rights Reserved +** +**--------------�ļ���Ϣ-------------------------------------------------------------------------------- +** +** �� �� ��: gjb_S0100904GN_4.c +** +** �ļ���������: 2021 �� 1 �� 22 �� +** +** �� ��: ʹ����������ͬʱ����һ�����߶���ȴ�����?/���̹��ܲ��� +*********************************************************************************************************/ +#include +#include +#include +#include +#include + +// #include "gjb.h" + +static int err_count_cv_9044 = 0; +static pthread_cond_t cond1_cv_9044 = PTHREAD_COND_INITIALIZER; /* cond used by the two threads */ +static pthread_mutex_t mutex2_cv_9044 = PTHREAD_MUTEX_INITIALIZER; /* cond used by the two threads */ + +void * thread2_cv_9044(void *tmp) +{ + int rc = 0; + + /* + * acquire the mutex + */ + rc = pthread_mutex_lock(&mutex2_cv_9044); + if (rc != 0) { + printf("test failed.pthread_mutex_lock\n"); + err_count_cv_9044++; + return NULL; + } + + /* + * Wait on the cond var. This will not return, as nobody signals + */ + rc = pthread_cond_wait(&cond1_cv_9044, &mutex2_cv_9044); + if (rc != 0) { + printf("test failed.pthread_cond_wait\n"); + err_count_cv_9044++; + return NULL; + } + + + rc = pthread_mutex_unlock(&mutex2_cv_9044); + if (rc != 0) { + printf("test failed.pthread_mutex_unlock\n"); + err_count_cv_9044++; + return NULL; + } + + return NULL; +} + +// int gjb_S0100904GN_4(int argc, char **argv) +int main(int argc, char **argv) +{ + pthread_t low_id; + int rc = 0; + + /* + * Create a new thread with default attributes + */ + rc = pthread_create(&low_id, NULL, thread2_cv_9044, NULL); + if (rc != 0) { + printf("pthread_create\n"); + goto __errno_handle; + } + + /* + * Let the other thread run + */ + sleep(2); + + rc = pthread_cond_broadcast(&cond1_cv_9044); + if (rc == 0) { + printf("test illegal pass.pthread_cond_broadcast return EINVAL\n"); + + } else { + printf("test failed:pthread_cond_broadcast should return EINVAL,but return %d\n",rc); + goto __errno_handle; + } + + rc = pthread_cond_broadcast(NULL); + if (rc == EINVAL) { + printf("test NULL pass.pthread_cond_broadcast return EINVAL\n"); + + } else { + printf("test failed:pthread_cond_broadcast should return EINVAL,but return %d\n",rc); + goto __errno_handle; + } + + if (err_count_cv_9044) { + goto __errno_handle; + } + printf("..................................................[(0)]\n \n \n"); + + return (0); + +__errno_handle: + printf("..................................................[(-1)]\n \n \n"); + return (-1); + +} -- Gitee From cbf0e955f8000dad887bc5ce246f3ec9a7d4bb3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=B7=B2=E4=B8=8D=E5=86=8D?= <1513930121@qq.com> Date: Mon, 30 Oct 2023 07:23:05 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=8C=E6=88=90=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 我已不再 <1513930121@qq.com> --- conditional_variable/gjb_S0100902GN_1.c | 107 ++++++++++++++++++++++++ conditional_variable/gjb_S0100902GN_3.c | 81 ++++++++++++++++++ 2 files changed, 188 insertions(+) create mode 100644 conditional_variable/gjb_S0100902GN_1.c create mode 100644 conditional_variable/gjb_S0100902GN_3.c diff --git a/conditional_variable/gjb_S0100902GN_1.c b/conditional_variable/gjb_S0100902GN_1.c new file mode 100644 index 0000000..1394d40 --- /dev/null +++ b/conditional_variable/gjb_S0100902GN_1.c @@ -0,0 +1,107 @@ +/********************************************************************************************************* +** +** GJB 标准测试集 +** +** Copyright All Rights Reserved +** +**--------------文件信息-------------------------------------------------------------------------------- +** +** 文 件 名: gjb_S0100902GN_1.c +** +** 文件创建日期: 2021 年 1 月 22 日 +** +** 描 述: 以永久阻塞方式等待条件变量功能测试 +*********************************************************************************************************/ +#include +#include +#include +#include +#include +#include + +//#include "gjb.h" + +static int err_count_cv_9021; + +pthread_cond_t cond_cv_9021 = PTHREAD_COND_INITIALIZER; /* cond used by the two threads */ + + +pthread_mutex_t mutex_cv_9021 = PTHREAD_MUTEX_INITIALIZER; /* cond used by the two threads */ + +void * thread_cv_9021(void *tmp) +{ + int rc = 0; + + /* + * acquire the mutex + */ + rc = pthread_mutex_lock(&mutex_cv_9021); + if(rc != 0) { + printf("test failed.pthread_mutex_lock\n"); + err_count_cv_9021++; + return (void *)-1; + } + + /* + * Wait on the cond var. This will not return, as nobody signals + */ + rc = pthread_cond_wait(&cond_cv_9021, &mutex_cv_9021); + if(rc == 0) { + printf("test pass,pthread_cond_wait return 0\n"); + + } else { + printf("test failed.pthread_cond_wait should return 0 , but return %d\n",rc); + err_count_cv_9021++; + return (void *)-1; + } + + rc = pthread_mutex_unlock(&mutex_cv_9021); + if(rc != 0) { + printf("test failed.pthread_mutex_unlock\n"); + err_count_cv_9021++; + return (void *)-1; + } + + return NULL; +} + +// int gjb_S0100902GN_1(int argc, char **argv) +int gjb_S0100902GN_1(int argc, char **argv) +{ + pthread_t low_id; + int rc = 0; + + /* + * Create a new thread with default attributes + */ + rc = pthread_create(&low_id, NULL, thread_cv_9021, NULL); + if(rc != 0) { + printf("pthread_create\n"); + goto __errno_handle; + } + + /* + * Let the other thread run + */ + sleep(2); + + + // pthread_kill(low_id, SIGTERM); + // pthread_kill(low_id, SIGKILL); + pthread_join(low_id, NULL); + if (err_count_cv_9021) { + goto __errno_handle; + } + + printf("..................................................[(0)]\n \n \n"); + + return (0); + +__errno_handle: + printf("..................................................[(-1)]\n \n \n"); + return (-1); +} + + + + diff --git a/conditional_variable/gjb_S0100902GN_3.c b/conditional_variable/gjb_S0100902GN_3.c new file mode 100644 index 0000000..41ca6a0 --- /dev/null +++ b/conditional_variable/gjb_S0100902GN_3.c @@ -0,0 +1,81 @@ +/********************************************************************************************************* +** +** GJB 标准测试集 +** +** Copyright All Rights Reserved +** +**--------------文件信息-------------------------------------------------------------------------------- +** +** 文 件 名: gjb_S0100902GN_3.c +** +** 文件创建日期: 2021 年 1 月 22 日 +** +** 描 述: 以永久阻塞方式等待条件变量功能测试 +*********************************************************************************************************/ +#include +#include +#include +#include +#include +#include + +//#include "gjb.h" + +static int err_count_cv_9023; + +pthread_cond_t cond2_cv_9023 = PTHREAD_COND_INITIALIZER; /* cond used by the two threads */ +pthread_mutex_t mutex3_cv_9023 = PTHREAD_MUTEX_INITIALIZER; /* cond used by the two threads */ + +void * thread2_cv_9023(void *tmp) +{ + int rc = 0; + + /* + * Wait on the cond var. This will not return, as nobody signals + */ + rc = pthread_cond_wait(&cond2_cv_9023, &mutex3_cv_9023); + if (rc == EPERM) { + printf("test pass,pthread_cond_wait return EPERM \n"); + + } else { + printf("test failed.pthread_cond_wait should return EPERM , but return %d\n",rc); + err_count_cv_9023++; + return (void *)-1; + } + + return NULL; +} + +int main(int argc, char **argv) +{ + pthread_t low_id; + int rc = 0; + + /* + * Create a new thread with default attributes + */ + rc = pthread_create(&low_id, NULL, thread2_cv_9023, NULL); + if(rc != 0) { + printf("pthread_create\n"); + goto __errno_handle; + } + + /* + * Let the other thread run + */ + sleep(2); + + // pthread_kill(low_id, SIGTERM); + pthread_join(low_id, SIGTERM); + if (err_count_cv_9023) { + goto __errno_handle; + } + + printf("..................................................[(0)]\n \n \n"); + + return (0); + +__errno_handle: + printf("..................................................[(-1)]\n \n \n"); + return (-1); +} -- Gitee From 0369003520859f9243a747aeddc661dfd5c9fbda Mon Sep 17 00:00:00 2001 From: cjj <1513930121@qq.com> Date: Mon, 30 Oct 2023 05:32:34 -0700 Subject: [PATCH 3/3] =?UTF-8?q?=E5=87=BD=E6=95=B0=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...75\346\225\260\350\256\260\345\275\225.docx" | Bin 0 -> 13862 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "conditional_variable/\346\235\241\344\273\266\345\217\230\351\207\217\344\277\256\346\224\271\345\207\275\346\225\260\350\256\260\345\275\225.docx" diff --git "a/conditional_variable/\346\235\241\344\273\266\345\217\230\351\207\217\344\277\256\346\224\271\345\207\275\346\225\260\350\256\260\345\275\225.docx" "b/conditional_variable/\346\235\241\344\273\266\345\217\230\351\207\217\344\277\256\346\224\271\345\207\275\346\225\260\350\256\260\345\275\225.docx" new file mode 100644 index 0000000000000000000000000000000000000000..70493ff932ed7416d66cc1e024a6688ea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