Boost Mutex Scoped Lock

Estaba leyendo un tutorial de Boost Mutex en drdobbs.com y encontré este fragmento de código:

#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/bind.hpp>
#include <iostream>

boost::mutex io_mutex;

void count(int id)
{
  for (int i = 0; i < 10; ++i)
  {
    boost::mutex::scoped_lock
      lock(io_mutex);
    std::cout << id << ": " <<
      i << std::endl;
  }
}

int main(int argc, char* argv[])
{
  boost::thread thrd1(
    boost::bind(&count, 1));
  boost::thread thrd2(
    boost::bind(&count, 2));
  thrd1.join();
  thrd2.join();
  return 0;
}

Ahora entiendo que el objetivo de un Mutex es evitar que dos subprocesos accedan al mismo recurso al mismo tiempo, pero no veo la correlación entre io_mutex y std :: cout. ¿Este código simplemente bloquea todo dentro del alcance hasta que finalice el alcance?

Respuestas a la pregunta(2)

Su respuesta a la pregunta