From 7d7872cb7b490f0de9aae668c84e273c189168d4 Mon Sep 17 00:00:00 2001 From: Anton Autushka Date: Tue, 6 Feb 2018 15:37:14 +0300 Subject: [PATCH] some minor fixes --- CMakeLists.txt | 2 ++ include/fc/static_variant.hpp | 1 + src/thread/mutex.cpp | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f7787d..d0819c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,8 @@ PROJECT( fc ) CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 ) +add_compile_options(-std=c++14) + MESSAGE(STATUS "Configuring project fc located in: ${CMAKE_CURRENT_SOURCE_DIR}") SET( CMAKE_AUTOMOC OFF ) diff --git a/include/fc/static_variant.hpp b/include/fc/static_variant.hpp index 4bfca85..d38408d 100644 --- a/include/fc/static_variant.hpp +++ b/include/fc/static_variant.hpp @@ -328,6 +328,7 @@ public: static int count() { return impl::type_info::count; } void set_which( tag_type w ) { + FC_ASSERT( w >= 0 ); FC_ASSERT( w < count() ); this->~static_variant(); _tag = w; diff --git a/src/thread/mutex.cpp b/src/thread/mutex.cpp index 2a87564..222d32e 100644 --- a/src/thread/mutex.cpp +++ b/src/thread/mutex.cpp @@ -15,9 +15,9 @@ namespace fc { mutex::~mutex() { if( m_blist ) { -// context* c = m_blist; fc::thread::current().debug("~mutex"); #if 0 + context* c = m_blist; while( c ) { // elog( "still blocking on context %p (%s)", m_blist, (m_blist->cur_task ? m_blist->cur_task->get_desc() : "no current task") ); c = c->next_blocked_mutex;