Skip to content

Commit 76b97b4

Browse files
Change type to atomic for variables in mock_drm_memory_manager.h
fix for sporadic failure in utl Change-Id: Icdcdd600e8114f0b73ade4bc5e714b98495645e7
1 parent bb4cf07 commit 76b97b4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

unit_tests/mocks/linux/mock_drm_memory_manager.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77

88
#include "runtime/os_interface/linux/drm_memory_manager.h"
99
#include "unit_tests/mocks/mock_host_ptr_manager.h"
10+
#include <atomic>
1011

1112
namespace OCLRT {
1213
static off_t lseekReturn = 4096u;
13-
static int lseekCalledCount = 0;
14-
static int mmapMockCallCount = 0;
15-
static int munmapMockCallCount = 0;
14+
static std::atomic<int> lseekCalledCount(0);
15+
static std::atomic<int> mmapMockCallCount(0);
16+
static std::atomic<int> munmapMockCallCount(0);
1617

1718
off_t lseekMock(int fd, off_t offset, int whence) noexcept {
1819
lseekCalledCount++;

0 commit comments

Comments
 (0)