class의 멤버 함수에서 thread 실행 시 에러 함수에서 thread 실행 후 그냥 함수가 종료 될 경우 아래와 같은 에러가 발생[root@TMSA thread]# ./threadterminate called without an active exception중지됨 thread 실행 후 join 또는 detach 로 핸들링 해야함.#include#include#include#include class MyClass{std::mutexmtx_count;intiCount;public :MyClass(){iCount = 0;}~MyClass(){} int getCount(){return iCount;} void workThread(int iIdx){while(1){mtx_count.lock();iCount+..
Start thread with member function(람다 이용) 출처[http://stackoverflow.com/questions/10673585/start-thread-with-member-function] Since you are using C++11, lambda-expression is a nice&clean solution.class blub { void test() {} public: std::thread spawn() { return std::thread( [this] { this->test(); } ); } };since this-> can be omitted, it could be shorten to:std::thread( [this] { test(); } )or juststd..
GNU Make 3.82 Makefile 옵션 as 명령에서 사용 옵션AS = gasASFLAGS = gcc 명령에서 사용 옵션CC = gccCFLAGS = g++ 명령에서 사용옵션CPP = g++CPPFLAGS = ld 명령에서 사용옵션LD = ldLDFLAGS = LIB_HOME = /root/myapp/libAPP_HOME = /root/myappOBJDIR = $(APP_HOME)/sourceOUTDIR = $(APP_HOME) CC = gccCXX = g++AR = ar LINT = lint CPPFLAGS = -g -std=c++11 -I$(LIB_HOME) SRCS = myapp.cpp test.cpp OBJS = $(SRCS:%.cpp=$(OBJDIR)/%.o) TARGET = myapp ..
- Total
- Today
- Yesterday
- _stats
- pfctl
- 센트6
- physicaldisk
- yum
- vgcreate
- lvremove
- CLion
- linux
- aix compile
- pf.anchors
- install
- ld 옵션
- CMAKE_OSX_SYSROOT
- fielddata
- aix ld
- lvm 늘리기
- CentOS
- Ignoring CMAKE_OSX_SYSROOT value
- virtualbox
- firewall-cmd service
- postgresql11
- Repository
- 물리디스크
- mirrorlist
- 파티션 추가
- _status
- centos7
- update
- noipath
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |