projects
/
platform
/
core
/
system
/
dlog.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1ef6ae8
)
Fix a race condition
32/299432/1
author
Michal Bloch
<m.bloch@samsung.com>
Mon, 25 Sep 2023 11:58:32 +0000
(13:58 +0200)
committer
Michal Bloch
<m.bloch@samsung.com>
Wed, 27 Sep 2023 13:20:53 +0000
(15:20 +0200)
Change-Id: I4c546d8e3479b7498c9ed2def85b7f710672b059
src/logger/reader_common.c
patch
|
blob
|
history
diff --git
a/src/logger/reader_common.c
b/src/logger/reader_common.c
index
a654476
..
3b69435
100644
(file)
--- a/
src/logger/reader_common.c
+++ b/
src/logger/reader_common.c
@@
-126,12
+126,12
@@
int reader_run(struct reader_common *const reader)
if (!reader->ops->thread_func)
return -ENOENT;
-
pthread_t thread
;
- i
nt r = pthread_create(&thread, NULL, reader->ops->thread_func, reader);
- if (r < 0)
+
int r = pthread_create(&reader->thread, NULL, reader->ops->thread_func, reader)
;
+ i
f (r < 0) {
+ reader->thread = 0;
return r;
+ }
- reader->thread = thread;
return 0;
}