Skip to content

Hutdris/StdThreadSample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StdThreadSample

A simple timer which implement by C++11 std::thread.

Note

joinable()

Thread is "unjoinable" before it is created or after joined, i.e., thread.joinalbe()=0.

join()

  1. mThread.join() will block current main thread and wait mThread is return.
  2. You can not join a thread twice. Since the second thread you join is another thread which created after the first join, it will lead to undefined behavior.

detach()

mThread.detach() do not care what mthread return, nor block and wait mThread finish. It just detach it and mThread will become an orphan and take care by system.

About

A simple timer which implement by C++11 std::thread.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages