-
Notifications
You must be signed in to change notification settings - Fork 85
Possible data race error due to missing locking #608
Copy link
Copy link
Open
Description
Hi, it seems treq->finished = false;(Line 279) is missing locking while other places (Line 289 and Line 264) are all locked.
ocf/tests/unit/tests/concurrency/ocf_cache_line_concurrency.c/ocf_cache_line_concurrency.c
Lines 277 to 293 in 865d29d
| struct timespec ts; | |
| treq->finished = false; | |
| result = pfn(c, req, req_async_lock_callback); | |
| assert(result >= 0); | |
| if (result == OCF_LOCK_ACQUIRED) { | |
| return true; | |
| } | |
| pthread_mutex_lock(&treq->completion_mutex); | |
| while (!treq->finished && !*finish) { | |
| pthread_cond_wait(&treq->completion, | |
| &treq->completion_mutex); | |
| } | |
| pthread_mutex_unlock(&treq->completion_mutex); |
ocf/tests/unit/tests/concurrency/ocf_cache_line_concurrency.c/ocf_cache_line_concurrency.c
Lines 263 to 266 in 865d29d
| pthread_mutex_lock(&treq->completion_mutex); | |
| treq->finished = true; | |
| pthread_cond_signal(&treq->completion); | |
| pthread_mutex_unlock(&treq->completion_mutex); |
Reactions are currently unavailable