Linux??????????????????????????
???????????? ???????[ 2013/1/30 10:04:08 ] ????????
????4???????????????
????1??????????????????????????
????2??????????????????????
????3???????????????????
????4??????ж????? ?????????ABC???????????????????ABC??
????5?????????????????????????????
????????????????
????1???????????
???????????????????????????о???????????????
????a????????
?????????????PTHREAD_COND_INITIALIZER???????磺pthread_cond_t cond = PTHREAD_COND_INITIALIZER
????b????????
????int pthread_cond_init(pthread_cond_t *cond??pthread_condattr_t *cond_attr)
??????? cond_attr ????????????????????? cond???? cond_attr? NULL???????????????LinuxThreads???????????????????????? cond_attr?????????????
????c?????
????int pthread_cond_destroy(pthread_cond_t *cond)
?????????????????????????pthread_cond_destroy()??????????????????????????????????????????????????????????EBUSY?????Linux??????????????з?????????????????????????????????е??????
????2??????????
????2.1 ???
????int pthread_cond_wait(pthread_cond_t *cond?? pthread_mutex_t *mutex)
?????????????POSIX???????????????????????????????????????????-wait-??????-????-?????
????2.2 ??????????
????int pthread_cond_timedwait(pthread_cond_t *cond?? pthread_mutex_t *mutex?? conststruct timespec *abstime)
????pthread_cond_timedwait?? pthread_cond_wait?????????????????????????????????????????????????????? abstime?????????? condδ???????????? mutex???????????????????? ETIMEDOUT??abstime????????????????????? time?? gettimeofday?????abstime = 0??? 1970 ?? 1?? 1 ?? 00:00:00 GMT??
????2.3 ????
????int pthread_cond_signal(pthread_cond_t *cond);
????int pthread_cond_broadcast(pthread_cond_t *cond);
???????????????????????pthread_cond_signal()??????????????????????????????????????????????????????????????????????????????????????pthread_cond_broadcast()???????е????????Щ???????????ξ???????????????
??????????????????????????????????????????????????????????????????п?????????????????pthread_cond_wait()??????????????????????????????
????????????????????????
??????????????????????????????????????????????????????У??????????????????????????????????????????????????????????磬??????????????????????????????????????????????????????????????????????????????ζ????鹲???????????????????????????????????????????????????????Ч????????????????μ????????????????????????????3s?????????????????????????????
??????????????????????????????????????????????????????????????????????????????????????????????á????????????????????????????????????????????????????????????????????????????????仯???????????????????????????????????????????????????????????????????????????????????????Щ???????????????????????2??????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11