Skip to content

Commit

Permalink
fix: increment g_attempts atomically on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
aegoroff committed Feb 23, 2024
1 parent 437354e commit 979ee59
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/srclib/bf.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ static volatile apr_uint32_t g_already_found = FALSE;
static uint32_t g_gpu_variant_ix = 0;
static const unsigned char k_ascii_first = '!';
static const unsigned char k_ascii_last = '~';

#ifdef _MSC_VER
static uint64_t g_attempts;
#else
_Atomic static uint64_t g_attempts;
#endif

static const unsigned char* prbf_prepare_dictionary(const unsigned char* dict, apr_pool_t* pool);
static void* APR_THREAD_FUNC prbf_cpu_thread_func(apr_thread_t* thd, void* data);
Expand Down

0 comments on commit 979ee59

Please sign in to comment.