--- libev/ev.pod 2020/03/22 15:13:17 1.465 +++ libev/ev.pod 2020/06/08 11:15:59 1.466 @@ -3864,10 +3864,10 @@ First, you need to associate some data with the event loop: typedef struct { - mutex_t lock; /* global loop lock */ + pthread_mutex_t lock; /* global loop lock */ + pthread_t tid; + pthread_cond_t invoke_cv; ev_async async_w; - thread_t tid; - cond_t invoke_cv; } userdata; void prepare_loop (EV_P) @@ -3875,19 +3875,19 @@ // for simplicity, we use a static userdata struct. static userdata u; - ev_async_init (&u->async_w, async_cb); - ev_async_start (EV_A_ &u->async_w); + ev_async_init (&u.async_w, async_cb); + ev_async_start (EV_A_ &u.async_w); - pthread_mutex_init (&u->lock, 0); - pthread_cond_init (&u->invoke_cv, 0); + pthread_mutex_init (&u.lock, 0); + pthread_cond_init (&u.invoke_cv, 0); // now associate this with the loop - ev_set_userdata (EV_A_ u); + ev_set_userdata (EV_A_ &u); ev_set_invoke_pending_cb (EV_A_ l_invoke); ev_set_loop_release_cb (EV_A_ l_release, l_acquire); // then create the thread running ev_run - pthread_create (&u->tid, 0, l_run, EV_A); + pthread_create (&u.tid, 0, l_run, EV_A); } The callback for the C watcher does nothing: the watcher is used