Updates from BitShares FC #22

Closed
nathanielhourt wants to merge 693 commits from dapp-support into latest-fc
2 changed files with 16 additions and 0 deletions
Showing only changes of commit 127aadbffc - Show all commits

View file

@ -131,6 +131,11 @@ namespace fc {
* @todo make quit non-blocking of the calling thread by eliminating the call to <code>boost::thread::join</code>
*/
void quit();
/**
* Send signal to underlying native thread. Only for Linux and macOS
*/
void signal(int);
/**
* @return true unless quit() has been called.

View file

@ -156,6 +156,17 @@ namespace fc {
void thread::debug( const fc::string& d ) { /*my->debug(d);*/ }
#if defined(__linux__) || defined(__APPLE__)
#include <signal.h>
#endif
void thread::signal(int sig)
{
#if defined(__linux__) || defined(__APPLE__)
pthread_kill( my->boost_thread->native_handle(), sig );
#endif
}
void thread::quit()
{
//if quitting from a different thread, start quit task on thread.