Skip to content

Commit

Permalink
Merge pull request #616 from muflihun/develop
Browse files Browse the repository at this point in the history
potential wrapper for mutex
  • Loading branch information
abumq authored Feb 23, 2018
2 parents e9dc1ec + 2ca71dd commit c03b2c1
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ release.info
bin/*
logs/*
experiments/*
CMakeLists.txt.user
CMakeLists.txt.user*
55 changes: 51 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,55 @@
language: cpp
compiler:
- gcc
os: linux
dist: trusty
matrix:
include:
- os: linux
dist: trusty
compiler: clang
- os: linux
dist: trusty
compiler: gcc
env:
- COMPILER=g++-4.8
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: [g++-4.8, valgrind]
- os: linux
dist: trusty
compiler: gcc
env:
- COMPILER=g++-4.9
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: [g++-4.9, valgrind]
- os: linux
dist: trusty
compiler: gcc
env:
- COMPILER=g++-5
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: [g++-5, valgrind]
- os: linux
dist: trusty
compiler: gcc
env:
- COMPILER=g++-6
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: [g++-6, valgrind]
- os: linux
dist: trusty
compiler: gcc
env:
- COMPILER=g++-7
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: [g++-7, valgrind]

before_install:
- sudo apt-get -qq update
- sudo apt-get install -y libgtest-dev valgrind cmake
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
<a href="#submitting-patches">Submitting Patches</a>
<a href="#reporting-a-bug">Reporting a Bug</a>
<a href="#compatibility">Compatibility</a>
<a href="#build-matrix">Build Matrix</a>
<a href="#licence">Licence</a>
<a href="#disclaimer">Disclaimer</a>
</pre>
Expand Down Expand Up @@ -1437,6 +1438,23 @@ Easylogging++ has also been tested with following C++ libraries;

[![top] Goto Top](#table-of-contents)

## Build Matrix

| Branch | Platform | Build Status |
| -------- |:------------:|:------------:|
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `clang++` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/develop/1)](https://travis-ci.org/muflihun/easyloggingpp) |
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-4.9` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/develop/2)](https://travis-ci.org/muflihun/easyloggingpp) |
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-5` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/develop/3)](https://travis-ci.org/muflihun/easyloggingpp) |
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-6` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/develop/4)](https://travis-ci.org/muflihun/easyloggingpp) |
| `develop` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-7` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/develop/5)](https://travis-ci.org/muflihun/easyloggingpp) |
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `clang++` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/master/1)](https://travis-ci.org/muflihun/easyloggingpp) |
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-4.9` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/master/2)](https://travis-ci.org/muflihun/easyloggingpp) |
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-5` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/master/3)](https://travis-ci.org/muflihun/easyloggingpp) |
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-6` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/master/4)](https://travis-ci.org/muflihun/easyloggingpp) |
| `master` | GNU/Linux 4.4 / Ubuntu 4.8.4 64-bit / `g++-7` | [![Build Status](https://travis-matrix-badges.herokuapp.com/repos/muflihun/easyloggingpp/branches/master/5)](https://travis-ci.org/muflihun/easyloggingpp) |

[![top] Goto Top](#table-of-contents)

# Licence
```
The MIT License (MIT)
Expand Down
4 changes: 2 additions & 2 deletions samples/STL/multi-loggers-to-same-file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
INITIALIZE_EASYLOGGINGPP

void def() {
for (int i = 0; i < 10000; ++i)
for (int i = 0; i < 1000; ++i)
CLOG(INFO, "first") << "This is from first " << i;
}

void second() {
for (int i = 0; i < 10000; ++i)
for (int i = 0; i < 1000; ++i)
CLOG(INFO, "second") << "This is from second" << i;
}

Expand Down
2 changes: 1 addition & 1 deletion src/easylogging++.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2105,7 +2105,7 @@ void LogDispatchCallback::handle(const LogDispatchData* data) {
std::string filename = data->logMessage()->logger()->typedConfigurations()->filename(data->logMessage()->level());
auto lock = m_fileLocks.find(filename);
if (lock == m_fileLocks.end()) {
m_fileLocks.emplace(std::make_pair(filename, new base::threading::Mutex));
m_fileLocks.emplace(std::make_pair(filename, std::unique_ptr<base::threading::Mutex>(new base::threading::Mutex)));
}
#endif
}
Expand Down

0 comments on commit c03b2c1

Please sign in to comment.