Go: fixing racing condition on app start.

Request procesing loop should be started in ready handler to avoid race
between go-routine start and context ready flag assignment.

The issue introduced in 43553aa72111.
This commit is contained in:
Max Romanov
2021-11-08 23:04:38 +03:00
parent 98c9763189
commit da0826e99f
2 changed files with 9 additions and 5 deletions

View File

@@ -30,6 +30,7 @@ nxt_cgo_run(uintptr_t handler)
init.callbacks.port_send = nxt_cgo_port_send;
init.callbacks.port_recv = nxt_cgo_port_recv;
init.callbacks.shm_ack_handler = nxt_go_shm_ack_handler;
init.callbacks.ready_handler = nxt_go_ready;
init.data = (void *) handler;