diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-09-21 22:23:47 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-09-21 22:23:47 (GMT) |
commit | 76fb13178cf6be94b8e01675b37f7cb1b92f7709 (patch) | |
tree | a6e6bbc6dde169add608097ceb5658fcb904bd08 /src/analysis/db/items/comment.c | |
parent | dfe76faf21e254c02c86a1b0b1f8ca8fc07fe027 (diff) |
Defined lock mechanism for buffer caches.
Diffstat (limited to 'src/analysis/db/items/comment.c')
-rw-r--r-- | src/analysis/db/items/comment.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/analysis/db/items/comment.c b/src/analysis/db/items/comment.c index 136b62b..bdff3a6 100644 --- a/src/analysis/db/items/comment.c +++ b/src/analysis/db/items/comment.c @@ -731,11 +731,12 @@ static bool g_db_comment_run(GDbComment *comment, GLoadedBinary *binary, bool ap const mrange_t *range; /* Emplacement d'instruction */ size_t linked; /* Indice lié à traiter */ - result = true; + result = false; cache = g_loaded_binary_get_disassembly_cache(binary); + if (cache == NULL) goto exit; - g_buffer_cache_lock(cache); + g_buffer_cache_wlock(cache) switch (comment->type) { @@ -813,10 +814,14 @@ static bool g_db_comment_run(GDbComment *comment, GLoadedBinary *binary, bool ap } - g_buffer_cache_unlock(cache); + g_buffer_cache_wunlock(cache); g_object_unref(G_OBJECT(cache)); + result = true; + + exit: + return result; } |