Skip to content

Commit

Permalink
grep mutex fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kohnish committed Aug 15, 2023
1 parent a127b38 commit 150573e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion native/app/grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,16 @@ static void grep_task(uv_work_t *req) {
}

int queue_grep(uv_loop_t *loop, const char *cmd, const char *list_cmd, int seq) {
toggle_grep_init(1);
uv_work_t *req = malloc(sizeof(uv_work_t));
search_data_t *search_data = malloc(sizeof(search_data_t));
search_data->seq_ = seq;
strcpy(search_data->cmd, cmd);
strcpy(search_data->list_cmd, list_cmd);
req->data = search_data;
toggle_grep_init(1);
int ret = uv_queue_work(loop, req, grep_task, after_grep_task);
if (ret != 0) {
toggle_grep_init(0);
free(search_data);
free(req);
return -1;
Expand Down

0 comments on commit 150573e

Please sign in to comment.