Fix un released lock

Fix un released lock state.lock in the main before the program exits.
This commit is contained in:
ryancaicse 2021-09-14 14:17:46 +08:00 committed by pancake
parent ad48d39666
commit faddc6a3d5

View File

@ -464,6 +464,7 @@ int main(int argc, char **argv) {
RThread *th = r_th_new (worker_th, &state, 0);
if (!th) {
eprintf ("Failed to start thread.\n");
r_th_lock_leave (state.lock);
exit (-1);
}
r_pvector_push (&workers, th);