Damien Zammit, le mar. 02 mars 2021 22:41:36 +1100, a ecrit:
> @@ -108,6 +226,11 @@ main (int argc, char **argv)
>    if (err)
>      error (1, err, "Setting permissions");
>  
> +  err = pthread_create (&nt, NULL, netfs_server_func, NULL);
> +  if (err)
> +    error (1, err, "Creating netfs loop thread");
> +  pthread_detach (nt);
> +

This should actually completely replace

> @@ -116,5 +239,8 @@ main (int argc, char **argv)
>  
>    netfs_server_loop ();              /* Never returns.  */

That, shouldn't it?

> +  /* Let the other threads do their job */
> +  pthread_exit(NULL);

And indeed use that to let threads flow.

Samuel

Reply via email to