OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-link-grammar commits / 3c23a1c

form_match_list(): Don't use _Atomic
There is no need to ensure the "id" variable is incremented in an atomic way, because we don't care if two threads will use the same value. The crash that got debugged on commit 9f73b372 was due to another reason: not using "id" variable if it is 0. This has been fixed. Removing it gets rid of some small overhead, and also allows MSVC compilation.
3c23a1c944970c27401f0f24afe49d4303fe322d
by ampli <amirpli@gmail.com> · 2024-05-30T01:37:41.000Z

Changed files (1) +2 -2

link-grammar/parse/fast-match.c +2 -2
……@@ -595,8 +595,8 @@ form_match_list(fast_matcher_t *ctxt, int w,
595595 }
596596
597597#ifdef VERIFY_MATCH_LIST
598 static _Atomic(uint16_t) id = 0;
599 uint16_t lid = ++id; /* A local copy, for multi-threading support. */
598 static uint16_t id = 0;
599 uint16_t lid = ++id; /* A stable local copy, for multi-threading support. */
600600#else
601601 const uint16_t lid = 0;
602602#endif