Skip to content

Instantly share code, notes, and snippets.

@shenyute
Created December 1, 2012 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shenyute/4183334 to your computer and use it in GitHub Desktop.
Save shenyute/4183334 to your computer and use it in GitHub Desktop.
#include <boost/bind.hpp>
#include <boost/thread.hpp>
class X {
public:
void run();
void complexOperation( int limit );
};
int main()
{
X x;
boost::thread thr1( boost::bind( &X::run, &x ) );
boost::thread thr2( boost::bind( &X::complexOperation, &x, 30 ) );
thr1.join();
thr2.join();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment