diff --git a/build/Jamfile b/build/Jamfile index 874a595f..227b10b4 100644 --- a/build/Jamfile +++ b/build/Jamfile @@ -25,7 +25,7 @@ import ./threads ; mutex once recursive_mutex - read_write_mutex +# read_write_mutex thread tss_hooks tss_dll diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 872f2939..cc97011b 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -20,7 +20,7 @@ CPP_SOURCES = mutex once recursive_mutex - read_write_mutex +# read_write_mutex thread tss_hooks tss_dll diff --git a/src/read_write_mutex.cpp b/src/read_write_mutex.cpp index bbcb79d4..9e250ee2 100644 --- a/src/read_write_mutex.cpp +++ b/src/read_write_mutex.cpp @@ -7,6 +7,9 @@ /* PROBLEMS: +The read write mutex currently is broken. Do not use it. +The file is supplied just for reference. + The algorithms are not exception safe. For instance, if conditon::wait() or another call throws an exception, the lock state and other state data are not appropriately adjusted. diff --git a/src/recursive_mutex.cpp b/src/recursive_mutex.cpp index 50351502..ebe17c1a 100644 --- a/src/recursive_mutex.cpp +++ b/src/recursive_mutex.cpp @@ -291,7 +291,8 @@ recursive_mutex::recursive_mutex() res = pthread_mutex_init(&m_mutex, &attr); { - int res = pthread_mutexattr_destroy(&attr); + int res = 0; + res = pthread_mutexattr_destroy(&attr); assert(res == 0); } if (res != 0) @@ -447,7 +448,8 @@ recursive_try_mutex::recursive_try_mutex() res = pthread_mutex_init(&m_mutex, &attr); { - int res = pthread_mutexattr_destroy(&attr); + int res = 0; + res = pthread_mutexattr_destroy(&attr); assert(res == 0); } if (res != 0) diff --git a/test/Jamfile b/test/Jamfile index cda3bc4d..4e1b5f29 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -64,7 +64,7 @@ import testing ; [ run test_once.cpp