c++11 并发的简单应用

future.cpp#include <chrono> #include <iostream> #include <future> #include <thread> std::string call_back(std::string name) { std::cout << "call_back run start " << "thread_name: " << name << " thread_id: " <<...

log4cplus thread_pool源码

ThreadPool.h// -*- C++ -*- // Copyright (c) 2012-2015 Jakob Progsch // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to u...

log4cplus库简单封装使用

Logger.h#ifndef AURORA_LOGGER_H #define AURORA_LOGGER_H #include "Common.h" #include <log4cplus/logger.h> #include <string> namespace aurora { class Logger : noncopyable { static constexpr int LOG_BUFFER_SIZE = 1024; public: static void ...

CMake简单学习

# CMake 最低版本号 cmake_minimum_required(VERSION 2.8) # 项目信息 project(main) # 添加版本号 set (main_VERSION_MAJOR 1) set (main_VERSION_MINOR 0) set (CMAKE_INCLUDE_CURRENT_DIR ON) # 是否使用自己的库 option(USE_MYMATH "USE provided math implementation" ON) # 检查系统环境 必须放在configure_file命令前 include (${...

log4cplus配置文件

## asynchronous log properties.异步 log4cplus.logger.global = INFO, Aurora log4cplus.appender.Aurora=log4cplus::AsyncAppender # 异步Appender的队列大小 log4cplus.appender.Aurora.QueueLimit=10000 # 文件输出位置 log4cplus.appender.Aurora.Appender=log4cplus::DailyRollingFileAppender # 设置存储的频率 log4cplus.appender.Aur...

clang-format配置文件

#基于那个配置文件 BasedOnStyle: Google Language: Cpp ColumnLimit: 120 BraceWrapping: # class定义后面 AfterClass: false # 控制语句后面 AfterControlStatement: false # enum定义后面 AfterEnum: true # 函数定义后面 AfterFunction: false # 命名空间定义后面 AfterNamespace: false # ObjC定义后面 AfterObjCDeclaration: false # st...

Ubuntu MySQL安装与卸载

# 查看本机安装MySQL dpkg -l | grep mysql # 卸载本机MySQL sudo apt-get autoremove --purge mysql-server-5.7 sudo apt-get remove mysql-server sudo apt-get autoremove mysql-server sudo apt-get remove mysql-common sudo apt remove mysql-client-core-5.7 dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P # 安...