Question about Boost Mutex Implementation

C

chsalvia

I was browsing through the souce code for the boost mutex
implementation just to understand how the library works. I get the
basic idea: a mutex object is associated with a scoped_lock object.
The scoped_lock object calls private member functions of the mutex,
specifically mutex::do_lock and mutex::do_unlock via static functions
defined in the lock_ops class.

My question is, where is the actual platform-specific call to actually
lock the mutex primitive, e.g. the call to pthread_mutex_lock? In the
boost source code, in the mutex.hpp file, the private member function
do_lock() is declared but not actually defined. Where is the code
that actually calls the platform-specific lock function?
 
Z

Zeppe

I was browsing through the souce code for the boost mutex
implementation just to understand how the library works. I get the
basic idea: a mutex object is associated with a scoped_lock object.
The scoped_lock object calls private member functions of the mutex,
specifically mutex::do_lock and mutex::do_unlock via static functions
defined in the lock_ops class.

My question is, where is the actual platform-specific call to actually
lock the mutex primitive, e.g. the call to pthread_mutex_lock? In the
boost source code, in the mutex.hpp file, the private member function
do_lock() is declared but not actually defined. Where is the code
that actually calls the platform-specific lock function?

http://www.google.com/codesearch?hl=en&q=+lang:c+++package:boost+
do_lock+show:A39GR61BV8A:pObAh4uKr8:6IDZIkSVSO4&sa=N&cd=5&ct=rc&cs_p=cvs+
:pserver:anonymous%40boost.cvs.sourceforge.net:/cvsroot/boost-sandbox
+boost-sandbox&cs_f=boost/shmem/sync/posix/shared_mutex.hpp#first

[rebuild the link]

Regards,

Zeppe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top