Created
June 22, 2014 19:47
-
-
Save mer30hamid/c03d1a958ee247aa763e to your computer and use it in GitHub Desktop.
Threading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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