🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c++
Article #960

Re: What does this code

#960
From: Chris M. Thomasson
Date: Fri, 20 Nov 2026 22:39
16 lines
1695 bytes
On 11/19/2026 11:48 PM, Bonita Montero wrote:
> Cool code without any branches and conditional
> moves if the compiler does it as I intended.
> 
> inline xsm_lock::operator int() const noexcept
> {
>      return (int)m_shared | -(int)!m_pMtx;
> }
> 
> m_pMtx is a pointer.
> Chris, I'm sure *you* would use relacy with that.
> 

;^) What is m_shared? A raw pointer?

Btw, there is no shame in using an interesting race detector.
Technical Details
Message-ID: <11dqi6j$3jvib$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11dou16$2vlr8$1@raubtier-asyl.eternal-september.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Newsgroups: comp.lang.c++
Subject: Re: What does this code
Date: Fri, 20 Nov 2026 14:39:12 -0800
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <11dqi6j$3jvib$1@dont-email.me>
References: <11dou16$2vlr8$1@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 20 Nov 2026 22:39:16 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3800651"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+HFn8TiIBTMaKkf9AT9+y6LEZ54Y/ZnCc="; posting-host="fa5c50218976ec21e33b4cef826fe31b"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:s0zV/95Huxat9DYuYRrwn5VMWT8= sha256:Vg9JyrjANoTGHI1wZplgwtJ8utBzXDR0RZWcQOPiCsY=
	sha1:jxkPCRc9Qs444049L3ma4KJHRzI= sha256:FYnOU9dBhORTuDyfWfNZrXJIxeia6mruFVqMlOETcfw=
In-Reply-To: <11dou16$2vlr8$1@raubtier-asyl.eternal-september.org>
Content-Language: en-US