Maintaining a count with two threads using conditional variables

I saw this closure today. Why is this closed as off topic? This contains code written by me, and I received a very nice answer.

What point am I missing?


The cited reason for the closure is not that it was someone else's code, but that the code looked hypothetical.

Normally, function names like foo, bar, or functionA are indicators that the code is hypothetical. Also, comments like // Do something are stub code. Questions containing such vague code are generally unreviewable, since there is too much left to the imagination.

On the other hand, your question looks more like a simple demonstration that happens to have generic-looking function names. It is a concrete program with a stated purpose. You're asking for suggested improvements to the code and not generic best practices.

In my opinion, the question is on-topic. Some users may still think that the example is a bit on the hypothetical side since the demonstration doesn't do anything very useful. However, it's not a clear-cut case that merits closure by a single moderator's decision. I've reopened the question.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .