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?
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?