Skip to content

Commit 2502b27

Browse files
committed
Fix "variable set but not used" errors caused by previous commit
1 parent 5c6180f commit 2502b27

2 files changed

Lines changed: 5 additions & 22 deletions

File tree

include/boost/thread/pthread/condition_variable_fwd.hpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,11 @@ namespace boost
7676
}
7777
~condition_variable()
7878
{
79-
int ret;
8079
//#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
8180
// ditto
82-
ret = posix::pthread_mutex_destroy(&internal_mutex);
83-
BOOST_ASSERT(!ret);
81+
BOOST_VERIFY(!posix::pthread_mutex_destroy(&internal_mutex));
8482
//#endif
85-
ret = posix::pthread_cond_destroy(&cond);
86-
BOOST_ASSERT(!ret);
83+
BOOST_VERIFY(!posix::pthread_cond_destroy(&cond));
8784
}
8885

8986
void wait(unique_lock<mutex>& m);

include/boost/thread/pthread/mutex.hpp

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ namespace boost
5353
}
5454
~mutex()
5555
{
56-
int const res = posix::pthread_mutex_destroy(&m);
57-
boost::ignore_unused(res);
58-
BOOST_ASSERT(!res);
56+
BOOST_VERIFY(!posix::pthread_mutex_destroy(&m));
5957
}
6058

6159
void lock() BOOST_THREAD_ACQUIRE()
@@ -69,13 +67,7 @@ namespace boost
6967

7068
void unlock() BOOST_THREAD_RELEASE()
7169
{
72-
int res = posix::pthread_mutex_unlock(&m);
73-
(void)res;
74-
BOOST_ASSERT(res == 0);
75-
// if (res)
76-
// {
77-
// boost::throw_exception(lock_error(res,"boost: mutex unlock failed in pthread_mutex_unlock"));
78-
// }
70+
BOOST_VERIFY(!posix::pthread_mutex_unlock(&m));
7971
}
8072

8173
bool try_lock() BOOST_THREAD_TRY_ACQUIRE(true)
@@ -184,13 +176,7 @@ namespace boost
184176

185177
void unlock()
186178
{
187-
int res = posix::pthread_mutex_unlock(&m);
188-
(void)res;
189-
BOOST_ASSERT(res == 0);
190-
// if (res)
191-
// {
192-
// boost::throw_exception(lock_error(res,"boost: mutex unlock failed in pthread_mutex_unlock"));
193-
// }
179+
BOOST_VERIFY(!posix::pthread_mutex_unlock(&m));
194180
}
195181

196182
bool try_lock()

0 commit comments

Comments
 (0)