Skip to content

Instantly share code, notes, and snippets.

@mer30hamid
Created June 22, 2014 19:47
Show Gist options
  • Save mer30hamid/c03d1a958ee247aa763e to your computer and use it in GitHub Desktop.
Save mer30hamid/c03d1a958ee247aa763e to your computer and use it in GitHub Desktop.
Threading
#include <nana/gui/wvl.hpp>
#include <nana/threads/pool.hpp>
void foo()
{
//This function will be “called” in other
//thread that is created by thread pool.
}
int main()
{
using namespace nana::gui;
using namespace nana::threads;
pool thrpool;
form fm;
fm.make_event<events::click>(pool_push(thrpool, foo));
fm.make_event<events::click>(pool_push(thrpool, []{
//A lambda is also allowed.
}));
fm.show();
exec();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment