Wrap uses of thread_mpi/mutex.h
authorTeemu Murtola <teemu.murtola@gmail.com>
Sun, 5 Jul 2015 04:12:43 +0000 (07:12 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 7 Jul 2015 07:34:33 +0000 (09:34 +0200)
commitd56c6f64ef2ba1ec31ec495c5204adbad24ab9ee
treea29725d12e1fdc2544ae6ada8512a63bf2ab7873
parent81671a3f5d59edb62e64e8e07953f40f4d352caa
Wrap uses of thread_mpi/mutex.h

Introduce gmx::Mutex and gmx::lock_guard to hide the actual C++ mutex
implementation used, and make all code that was using tMPI::Mutex use
these.

For now, the implementation is just directly imported from thread-MPI,
but this allows changing the implementation (e.g., to C++11 std::mutex
or to a TBB mutex) when thread-MPI is no longer appropriate, with mainly
changing this single header.  Also, this makes it clearer to introduce
new C++ wrappers for things like tMPI_Lock_t, as they can now be written
in this wrapper layer, instead of in thread-MPI where they will
introduce additional such dependencies.

Change-Id: Ie4c91d4e74c5dbc5e4d2b5d7fb5a76b73ef5616b
src/gromacs/commandline/cmdlineprogramcontext.cpp
src/gromacs/fft/fft5d.cpp
src/gromacs/fft/fft_fftw3.cpp
src/gromacs/selection/nbsearch.cpp
src/gromacs/utility/errorcodes.cpp
src/gromacs/utility/mutex.h [new file with mode: 0644]
src/testutils/testoptions.cpp