mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-28 20:02:00 +03:00
Enable -Wsuggest-override if supported by the compiler.
This commit is contained in:
@ -20,6 +20,7 @@
|
||||
#ifndef WSREP_CONDITION_VARIABLE_HPP
|
||||
#define WSREP_CONDITION_VARIABLE_HPP
|
||||
|
||||
#include "compiler.hpp"
|
||||
#include "lock.hpp"
|
||||
|
||||
#include <cstdlib>
|
||||
@ -59,17 +60,17 @@ namespace wsrep
|
||||
::abort();
|
||||
}
|
||||
}
|
||||
void notify_one()
|
||||
void notify_one() WSREP_OVERRIDE
|
||||
{
|
||||
(void)pthread_cond_signal(&cond_);
|
||||
}
|
||||
|
||||
void notify_all()
|
||||
void notify_all() WSREP_OVERRIDE
|
||||
{
|
||||
(void)pthread_cond_broadcast(&cond_);
|
||||
}
|
||||
|
||||
void wait(wsrep::unique_lock<wsrep::mutex>& lock)
|
||||
void wait(wsrep::unique_lock<wsrep::mutex>& lock) WSREP_OVERRIDE
|
||||
{
|
||||
if (pthread_cond_wait(
|
||||
&cond_,
|
||||
|
@ -20,15 +20,17 @@
|
||||
#ifndef WSREP_MUTEX_HPP
|
||||
#define WSREP_MUTEX_HPP
|
||||
|
||||
#include "compiler.hpp"
|
||||
#include "exception.hpp"
|
||||
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
namespace wsrep
|
||||
{
|
||||
//!
|
||||
//!
|
||||
//!
|
||||
/**
|
||||
* Mutex interface.
|
||||
*/
|
||||
class mutex
|
||||
{
|
||||
public:
|
||||
@ -61,7 +63,7 @@ namespace wsrep
|
||||
if (pthread_mutex_destroy(&mutex_)) ::abort();
|
||||
}
|
||||
|
||||
void lock()
|
||||
void lock() WSREP_OVERRIDE
|
||||
{
|
||||
if (pthread_mutex_lock(&mutex_))
|
||||
{
|
||||
@ -69,7 +71,7 @@ namespace wsrep
|
||||
}
|
||||
}
|
||||
|
||||
void unlock()
|
||||
void unlock() WSREP_OVERRIDE
|
||||
{
|
||||
if (pthread_mutex_unlock(&mutex_))
|
||||
{
|
||||
@ -77,7 +79,7 @@ namespace wsrep
|
||||
}
|
||||
}
|
||||
|
||||
void* native()
|
||||
void* native() WSREP_OVERRIDE
|
||||
{
|
||||
return &mutex_;
|
||||
}
|
||||
|
Reference in New Issue
Block a user