-
Notifications
You must be signed in to change notification settings - Fork 497
Closed
Description
Hi, developers:
If the pthread_create return 0,i.e., fails to create the thread, the function returns immediately with the lock rd.mutex unreleased. It is in the test folder but still worth fixing for higher quality. Thank you for your checking.
Line 248 in a209abe
| pthread_mutex_lock(&rd.mutex); |
Line 252 in a209abe
| ret = pthread_create(&recv_thread, NULL, recv_fn, &rd); |
The relevant code is shown here.
static int test(int use_sqthread, int regfiles)
{
...;
pthread_mutex_lock(&rd.mutex); // the lock is here
...;
ret = pthread_create(&recv_thread, NULL, recv_fn, &rd);
if (ret) {
fprintf(stderr, "Thread create failed: %d\n", ret);
return 1; // without releasing after returning
}
}
Best,
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels