Boost mutex functionality for R.