Why is it that newbies always feel that the world how them?
I was asking because locking things, mutexing, etc. and so forth seems
Ideally generic multthreading discussion should go to
comp.programming.threads. Platform specific ones or library specific
ones should go to a platform specific or library specific discussion
group.
This allows peoples with a common interest to discuss their common
interest together. The range of potential interest is so vast that it
is impossible to discuss them all at one place.
a pretty standard C++ feature,
It's not a C++ feature. It's a platform specific
facility/library/utility. But generic multithreading discussion are
welcome here.
To me, there is nothing *that* off-topic about asking about this
question. Sure, there is the CLR keyword that jumps out, but lock is
part of C++,
No it isn't. The concept of locks/mutex/etc is pretty much generic
at least Microsoft's interpretation of it.
It isn't either. It's part of Microsoft specific library that may or
may not be C++ compatible. It's one of the many library one can use
on Windows. There's a huge variety of them and I for one is unable to
know them all. I've used MS CriticalSection in the past but never
your #include said:
I saw plenty of things
posted to this group that had the stamp of "programming question" on
it. If someone here doesn't like the content, then make the group
moderated.
Programming questions are perfectly on-topic here if they are about
If I had a truly Windows-specific question, then I would have went
looking there (i.e MFC, forms, .NET, UI, MSDN, etc.) but this seems
pretty generic. Oh well. On to bigger and better things.
But it is Windows specific and it isn't generic. Where do you think
#include <msclr\lock.h> comes from?
Basically, peoples here don't know what is in #include
<msclr\lock.h>. It is not a part of C++. My only guess is that it is
a header file for one of the multitude of multithreading library that
exists. It's probably part of MS-CLR.
Essentially, your problem is an incompatibility between the code you
wrote and the way the lock from #include <msclr\lock.h> is supposed
to be used. In order to solve your problem, you need to read the
documentation about #include <msclr\lock.h> or the header file itself
or find some experts on #include <msclr\lock.h> that can help you.
Unfortunately for you, these expert don't live here. They are far
more likely to be found in a Microsoft CLR specific discussion group.
If instead of replying as an arrogant little newbie that think that the
world how him an answer you had come back with say:
-----------------------------------------------------------------------
Sorry, I didn't realise that #include <msclr\lock.h> was not part of
the C++ standard. However, here is the class definiton of lock taken
from the header file:
class lock
{
.....???? I have no idea what is here?
}
Here is my code:
lock(this);
This doesn't work, could anyone explain what I am doing wrong?
-------------------------------------------------------------------
Then you may very well have got a useful answer.
The incompatibility between your code and the class definition is
quite possibly a purely C++ issue. Without the class definition, we
have no idea.
Cheers anyway,
Yan