webrtc_m130/webrtc/base/sigslot.cc
kwiberg@webrtc.org 67186fe00c Fix clang style warnings in webrtc/base
Mostly this consists of marking functions with override when
applicable, and moving function bodies from .h to .cc files.

Not inlining virtual functions with simple bodies such as

  { return false; }

strikes me as probably losing more in readability than we gain in
binary size and compilation time, but I guess it's just like any other
case where enabling a generally good warning forces us to write
slightly worse code in a couple of places.

BUG=163
R=kjellander@webrtc.org, tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/47429004

Cr-Commit-Position: refs/heads/master@{#8656}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8656 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-03-09 22:24:25 +00:00

55 lines
1.2 KiB
C++

// sigslot.h: Signal/Slot classes
//
// Written by Sarah Thompson (sarah@telergy.com) 2002.
//
// License: Public domain. You are free to use this code however you like, with
// the proviso that the author takes on no responsibility or liability for any
// use.
#include "webrtc/base/sigslot.h"
namespace sigslot {
#ifdef _SIGSLOT_HAS_POSIX_THREADS
multi_threaded_global::multi_threaded_global() {
pthread_mutex_init(get_mutex(), NULL);
}
multi_threaded_global::multi_threaded_global(const multi_threaded_global&) {
}
multi_threaded_global::~multi_threaded_global() = default;
void multi_threaded_global::lock() {
pthread_mutex_lock(get_mutex());
}
void multi_threaded_global::unlock() {
pthread_mutex_unlock(get_mutex());
}
multi_threaded_local::multi_threaded_local() {
pthread_mutex_init(&m_mutex, NULL);
}
multi_threaded_local::multi_threaded_local(const multi_threaded_local&) {
pthread_mutex_init(&m_mutex, NULL);
}
multi_threaded_local::~multi_threaded_local() {
pthread_mutex_destroy(&m_mutex);
}
void multi_threaded_local::lock() {
pthread_mutex_lock(&m_mutex);
}
void multi_threaded_local::unlock() {
pthread_mutex_unlock(&m_mutex);
}
#endif // _SIGSLOT_HAS_POSIX_THREADS
}; // namespace sigslot