Skip to content

Commit

Permalink
added precompiled directives to beautify code
Browse files Browse the repository at this point in the history
  • Loading branch information
cogutvalera committed Sep 27, 2018
1 parent a77c378 commit 216484b
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions programs/cli_wallet/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@
# include <csignal>
#endif

#ifdef WIN32
#define QUIT_CURR_THREAD TerminateThread(pthread_self(), 0)
#else
#define QUIT_CURR_THREAD pthread_cancel(pthread_self())
#endif

using namespace graphene::app;
using namespace graphene::chain;
using namespace graphene::utilities;
Expand Down Expand Up @@ -283,21 +289,13 @@ int main( int argc, char** argv )
fc::set_signal_handler([&wapi, &wallet_file](int signal) {
ilog( "Captured SIGINT not in daemon mode" );
wapi->save_wallet_file(wallet_file.generic_string());
#ifdef WIN32
TerminateThread(pthread_self(), 0);
#else
pthread_cancel(pthread_self());
#endif
QUIT_CURR_THREAD;
}, SIGINT);

fc::set_signal_handler([&wapi, &wallet_file](int signal) {
ilog( "Captured SIGTERM not in daemon mode" );
wapi->save_wallet_file(wallet_file.generic_string());
#ifdef WIN32
TerminateThread(pthread_self(), 0);
#else
pthread_cancel(pthread_self());
#endif
QUIT_CURR_THREAD;
}, SIGTERM);

wallet_cli->wait();
Expand Down

0 comments on commit 216484b

Please sign in to comment.