From d5721b974a58ed5a26f33346dae728d93a7c1803 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Fri, 8 Oct 2010 07:01:44 +0300 Subject: boost threads and mutexes, better error handling (thread's timeouts) --- gpg_wrapper.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gpg_wrapper.cpp') diff --git a/gpg_wrapper.cpp b/gpg_wrapper.cpp index 226fd5e..a6c2723 100644 --- a/gpg_wrapper.cpp +++ b/gpg_wrapper.cpp @@ -18,12 +18,12 @@ //thx gpg module from Harald Treder, Zakhar V. Bardymov -HANDLE gpg_mutex = NULL; +boost::mutex gpg_mutex; pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD aexitcode, pxResult *result) { - WaitForSingleObject(gpg_mutex, INFINITE); + gpg_mutex.lock(); extern logtofile debuglog; BOOL success; STARTUPINFO sinfo = {0}; @@ -99,7 +99,6 @@ pxResult pxExecute(wstring *acommandline, char *ainput, string *aoutput, LPDWORD debuglog<<"gpg in: "<