Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Jens Gustedt Newsgroups: comp.lang.c,comp.programming.threads Subject: Re: Trivial C11 threads.h wrapper (public domain) Date: Mon, 01 Oct 2012 00:44:59 +0200 Organization: A noiseless patient Spider Lines: 23 Message-ID: <5068CB6B.1070900@loria.fr> References: <5065EAFD.1050102@loria.fr> <5068B604.9020606@web.de> <5068C9C3.6090502@loria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Injection-Info: mx04.eternal-september.org; posting-host="2590e4fa64e7931a8f955de6703c052f"; logging-data="15177"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19UUj+mFI6HSBb9HjKpDAWYX/IZlT6Vx9Y=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 In-Reply-To: <5068C9C3.6090502@loria.fr> Cancel-Lock: sha1:VjGQc5v0snT1KFgFzbPMbR+IqC0= Xref: csiph.com comp.lang.c:26917 comp.programming.threads:1131 Am 01.10.2012 00:37, schrieb Jens Gustedt: > Am 30.09.2012 23:28, schrieb Keith Thompson: >> Markus Elfring writes: >> 00633 // 7.26.4 Mutex functions >>> 00634 >>> 00638 p99_inline >>> 00639 void mtx_destroy(mtx_t *p00_mtx) { >>> 00640 (void)pthread_mutex_destroy(&P99_ENCP(p00_mtx)); >>> 00641 } > And then, finally, the C11 standard leaves no way to get semantic of a > failed call accros, here. Do you see a way to use the return value in > some way? Ah, thinking of it a bit more, it is actually not "(void)" which is problematic but the fact that the function may result in errno being set to a non-zero value. I'll replace by something like if (pthread_mutex_destroy(&P99_ENCP(p00_mtx))) errno = 0; Thanks Jens