| 30 | }; |
| 31 | |
| 32 | static void *thread_function(void *param) { |
| 33 | struct thread_data *p = (struct thread_data *) param; |
| 34 | sleep(2); // Simulate long execution |
| 35 | mg_wakeup(p->mgr, p->conn_id, "hi!", 3); // Respond to parent |
| 36 | mg_free((void *) p->message.buf); // Free all resources that were |
| 37 | free(p); // passed to us |
| 38 | return NULL; |
| 39 | } |
| 40 | |
| 41 | // HTTP request callback |
| 42 | static void fn(struct mg_connection *c, int ev, void *ev_data) { |