Skip to content

A locking problem in mk_scheduler.c  #5200

@ryancaicse

Description

@ryancaicse

It seems that the lock server->pth_mutex is missed to be released before Line 446

pthread_mutex_lock(&server->pth_mutex);
/* Thread data */
thconf = mk_mem_alloc_z(sizeof(struct mk_sched_thread_conf));
thconf->server = server;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
if (pthread_create(&tid, &attr, mk_sched_launch_worker_loop,
(void *) thconf) != 0) {
mk_libc_error("pthread_create");
return -1;
}
*tout = tid;
/* Block until the child thread is ready */
while (!server->pth_init) {
pthread_cond_wait(&server->pth_cond, &server->pth_mutex);
}
pthread_mutex_unlock(&server->pth_mutex);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions