Merge branch 'main' into maxiao_posix

This commit is contained in:
maxiao 2024-06-08 08:24:38 +08:00 committed by GitHub
commit 6695a6fad3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 25 additions and 3 deletions

View file

@ -43,9 +43,13 @@ struct event * event_create( void )
{
struct event * ev = malloc( sizeof( struct event ) );
ev->event_triggered = false;
pthread_mutex_init( &ev->mutex, NULL );
pthread_cond_init( &ev->cond, NULL );
if( ev != NULL )
{
ev->event_triggered = false;
pthread_mutex_init( &ev->mutex, NULL );
pthread_cond_init( &ev->cond, NULL );
}
return ev;
}