1
Jan 08 '19
const horny: boolean = process.env['horny'];
if (horny) {
initiateSex();
console.log(`Houston, we are go for launch!`);
} else {
abortSex();
console.log(`Houston, we have a problem!`);
}24
Dec 26 '18 edited Dec 26 '18
[removed] — view removed comment
3
-6
0
Dec 26 '18
[deleted]
21
u/CodenameLambda Dec 26 '18
Wouldn't you have one if
Partner.GetConsent()becomesfalsewhilesexWith(Partner)is executed? Also: IfPartneris set tonull(= the partner dies or something, I don't know) in another thread with the right timing, you can accidentally try to dereferencenull.Well, unless the world just runs on one thread.
Or
Partneris obtained using some kind of lock beforehand, which is released after the snippet.17
6
u/the1krutz Dec 26 '18
Just need to add a cancellation token to
sexWithso it can abort ifgetConsentever becomes false
100
u/[deleted] Dec 26 '18 edited Dec 26 '18
I love preprocessing.