parent
905b0c4aef
commit
07b87f6f1f
|
@ -903,9 +903,12 @@ extern "C" {
|
|||
|
||||
int pthread_cond_destroy(pthread_cond_t *cond)
|
||||
{
|
||||
if (!cond || !*cond)
|
||||
if (!cond)
|
||||
return EINVAL;
|
||||
|
||||
if (*cond == PTHREAD_COND_INITIALIZER)
|
||||
return 0;
|
||||
|
||||
Libc::Allocator alloc { };
|
||||
destroy(alloc, *cond);
|
||||
*cond = 0;
|
||||
|
@ -967,9 +970,12 @@ extern "C" {
|
|||
|
||||
int pthread_cond_signal(pthread_cond_t *cond)
|
||||
{
|
||||
if (!cond || !*cond)
|
||||
if (!cond)
|
||||
return EINVAL;
|
||||
|
||||
if (*cond == PTHREAD_COND_INITIALIZER)
|
||||
cond_init(cond, NULL);
|
||||
|
||||
pthread_cond *c = *cond;
|
||||
|
||||
pthread_mutex_lock(&c->counter_mutex);
|
||||
|
@ -987,9 +993,12 @@ extern "C" {
|
|||
|
||||
int pthread_cond_broadcast(pthread_cond_t *cond)
|
||||
{
|
||||
if (!cond || !*cond)
|
||||
if (!cond)
|
||||
return EINVAL;
|
||||
|
||||
if (*cond == PTHREAD_COND_INITIALIZER)
|
||||
cond_init(cond, NULL);
|
||||
|
||||
pthread_cond *c = *cond;
|
||||
|
||||
pthread_mutex_lock(&c->counter_mutex);
|
||||
|
|
Loading…
Reference in New Issue