I am having trouble getting the boost thread library to work. I am using Borland C++Builder 6 (on Win2k), and I tried the 1.29.0 release and the 1.30.0.b1 beta release and both give me the same errors in the condition.hpp file: line 93: " 'operator!' not implemented in type 'recursive_mutex' for arguments of the same type" and line 96: " 'recursive_mutex::m_mutex' is not accessible" Plus another 5 errors. I tried to look at the condition and recursive_mutex class definitions and I do not understand how they are implemented. Am I using it wrong to get that error? Let me know if you need a code sample. Thanks, Michael
Michael said:
I am having trouble getting the boost thread library to work. I am using Borland C++Builder 6 (on Win2k), and I tried the 1.29.0 release and the 1.30.0.b1 beta release and both give me the same errors in the condition.hpp file:
line 93: " 'operator!' not implemented in type 'recursive_mutex' for arguments of the same type"
and
line 96: " 'recursive_mutex::m_mutex' is not accessible"
Looking at these lines and making some assumptions, I think you're passing the wrong type to wait(). You need to pass a Lock, not a Mutex. IOW I think you have something like this: recursive_mutex mx; condition cond; while (pred) cond.wait(mx); when you should instead have this: recursive_mutex mx; condition cond; recursive_mutex::scoped_lock lock(mx); while (pred) cond.wait(lock);
Plus another 5 errors. I tried to look at the condition and recursive_mutex class definitions and I do not understand how they are implemented. Am I using it wrong to get that error?
I believe so, but you'll have to let me know if I interpreted things correctly. -- William E. Kempf
William E. Kempf wrote:
Michael said:
I am having trouble getting the boost thread library to work. I am using Borland C++Builder 6 (on Win2k), and I tried the 1.29.0 release and the 1.30.0.b1 beta release and both give me the same errors in the condition.hpp file:
If Williams answer doesn't help you, then perhaps you could post some code for us that demonstrates the problem. I've used conditions and mutexes on both BCB5 and 6 successfully. Cheers Russell
You are right. I had the code written as you said it should be but I
accidentally typed in the mutex name instead of the lock name.
Thanks for your help.
- Michael
--- In Boost-Users@yahoogroups.com, "William E. Kempf"
Michael said:
I am having trouble getting the boost thread library to work. I
using Borland C++Builder 6 (on Win2k), and I tried the 1.29.0 release and the 1.30.0.b1 beta release and both give me the same errors in the condition.hpp file:
line 93: " 'operator!' not implemented in type 'recursive_mutex' for arguments of the same type"
and
line 96: " 'recursive_mutex::m_mutex' is not accessible"
Looking at these lines and making some assumptions, I think you're
the wrong type to wait(). You need to pass a Lock, not a Mutex. IOW I think you have something like this:
recursive_mutex mx; condition cond; while (pred) cond.wait(mx);
when you should instead have this:
recursive_mutex mx; condition cond; recursive_mutex::scoped_lock lock(mx); while (pred) cond.wait(lock);
Plus another 5 errors. I tried to look at the condition and recursive_mutex class definitions and I do not understand how
am passing they are
implemented. Am I using it wrong to get that error?
I believe so, but you'll have to let me know if I interpreted things correctly.
-- William E. Kempf
participants (3)
-
Michael
-
Russell Hind
-
William E. Kempf