speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Remove the module_semaphore_init() function, and other changes a


From: Trevor Saunders
Subject: [PATCH] Remove the module_semaphore_init() function, and other changes associated with this 
Date: Sat, 10 Dec 2011 04:53:51 -0500

>  Add sem_destroy calls in module_close() (for all modules, excluding 
> espeak.c).

> - cicero_semaphore = module_semaphore_init();
> + if (0 != sem_init(&cicero_semaphore , 0, 0))
> + {

please use if (x) { in all of these cases
 Its worth noting from the sem_init() man page

NOTES
       Bizarrely, POSIX.1-2001 does not specify the value that should be
       returned  by  a  successful  call  to  sem_init().
              POSIX.1-2008 rectifies this, specifying the zero return on
              success.

 However a pthreads implementation that returns non 0 on success seems
 dubious to me.  In addition its not really clear to me that a
 reasonable semaphore implementation could be able to fail to
 initialize.
 However I can't really object to checking.

Trev




reply via email to

[Prev in Thread] Current Thread [Next in Thread]