summaryrefslogtreecommitdiff
path: root/src/tests/dlt-test-cpp-extension.cpp
diff options
context:
space:
mode:
authorDarian Biastoch <dbiastoch@de.adit-jv.com>2021-08-13 14:10:37 +0200
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2021-10-05 11:19:26 +0900
commitf7f7e84fe08c5f1ba138c070501f962b741a1f80 (patch)
treef57b9825c4e95b73ba670ec3928cbb1e3708d701 /src/tests/dlt-test-cpp-extension.cpp
parentdaf4247d8cf7570b7541e34af4bd93454e5bb550 (diff)
downloadDLT-daemon-f7f7e84fe08c5f1ba138c070501f962b741a1f80.tar.gz
dlt_user: Make dlt_init thread safe
This commit introduces the use of atomic_compare_exchange at beginning of both dlt_init functions. This function checks in an atomic way, if 'dlt_user_initialised' is 'false' (first run through dlt_init) and directly sets it 'true'. If a second thread also entered dlt-init at this point of time, its call of atomic_compare_exchange will return false and dlt_init will be immediately left due to that. This is only interesting for startup, because before each call of dlt_init, there is a check on 'dlt_user_initialised' that will fail for all later executions. Signed-off-by: Darian Biastoch <dbiastoch@de.adit-jv.com>
Diffstat (limited to 'src/tests/dlt-test-cpp-extension.cpp')
0 files changed, 0 insertions, 0 deletions