Re: pthread question

2015-10-07 Thread Jonas 'Sortie' Termansen
On 10/07/2015 12:53 PM, Stuart Henderson wrote: > if (pthread_kill(stat_thread, 0)) { pthread_kill sends the specified signal to the thread, but signal 0 just checks whether a signal can be sent and sends no signal.

Re: pthread question

2015-10-07 Thread Mark Kettenis
> X-Virus-Scanned: by XS4ALL Virus Scanner > Date: Wed, 7 Oct 2015 12:47:35 +0100 > From: Stuart Henderson > > Thanks. And I suppose in the case of a more complex program it couldn't > be guaranteed that the thread ID hasn't been reused by another thread > elsewhere in the

Re: pthread question

2015-10-07 Thread Stuart Henderson
On 2015/10/07 11:52, Stuart Henderson wrote: > monitoring-plugins has a program that checks available space on partitions. > Before doing this it does a stat() to check that the requested directory > exists and is accessible. In their devel tree they have moved to doing > this stat() in a thread -

pthread question

2015-10-07 Thread Stuart Henderson
monitoring-plugins has a program that checks available space on partitions. Before doing this it does a stat() to check that the requested directory exists and is accessible. In their devel tree they have moved to doing this stat() in a thread - commit log was "don't let check_disk hang on hanging

Re: pthread question

2015-10-07 Thread Stuart Henderson
Thanks. And I suppose in the case of a more complex program it couldn't be guaranteed that the thread ID hasn't been reused by another thread elsewhere in the program after the first one has exited. So I think a better approach for the check_disk program would be to pass in a pointer to a struct

Re: pthread question

2015-10-07 Thread Mark Kettenis
> Date: Wed, 7 Oct 2015 11:53:32 +0100 > From: Stuart Henderson > > On 2015/10/07 11:52, Stuart Henderson wrote: > > monitoring-plugins has a program that checks available space on partitions. > > Before doing this it does a stat() to check that the requested directory > >