[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haiku-commits
Subject:    [haiku-commits] Change in haiku[master]: kernel: Fix race condition when waiting for load of new tea
From:       Gerrit <review () review ! haiku-os ! org>
Date:       2018-12-26 23:41:58
Message-ID: gerrit.1545867717939.I93c45db8dd773fe42b45c4b67153bcd39e200d3b () review ! haiku-os ! org
[Download RAW message or body]

From Michael Lotz <mmlr@mlotz=2Ech>:

Michael Lotz has uploaded this change=
 for review=2E ( https://review=2Ehaiku-os=2Eorg/803


Change subject: kern=
el: Fix race condition when waiting for load of new team=2E
=2E=2E=2E=2E=2E=
=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=
=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=
=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E

kernel: Fix race condition w=
hen waiting for load of new team=2E

There was no synchronization of the ch=
eck of the done flag and the
waiting thread suspending to wait for it=2E It=
 was therefore possible that
the new team both set the flag and triggered t=
he wakeup of the waiting
thread in that time window, causing it to miss bot=
h the set flag and the
thread resumption=2E

Use a condition variable inste=
ad=2E

Fixes #13081=2E
---
M headers/private/kernel/thread_types=2Eh
M src/=
system/kernel/image=2Ecpp
M src/system/kernel/team=2Ecpp
3 files changed, 1=
2 insertions(+), 16 deletions(-)



  git pull ssh://git=2Ehaiku-os=2Eorg/h=
aiku refs/changes/03/803/1
-- 
To view, visit https://review=2Ehaiku-os=2Eo=
rg/803
To unsubscribe, or for help writing mail filters, visit https://revi=
ew=2Ehaiku-os=2Eorg/settings

Gerrit-Project: haiku
Gerrit-Branch: master
G=
errit-MessageType: newchange
Gerrit-Change-Id: I93c45db8dd773fe42b45c4b6715=
3bcd39e200d3b
Gerrit-Change-Number: 803
Gerrit-PatchSet: 1
Gerrit-Owner: Mi=
chael Lotz <mmlr@mlotz=2Ech>

[Attachment #3 (text/html)]

<p>Michael Lotz has uploaded this change for <strong>review</strong>.</p><p><a \
href="https://review.haiku-os.org/803">View Change</a></p><pre style="font-family: \
monospace,monospace; white-space: pre-wrap;">kernel: Fix race condition when waiting \
for load of new team.<br><br>There was no synchronization of the check of the done \
flag and the<br>waiting thread suspending to wait for it. It was therefore possible \
that<br>the new team both set the flag and triggered the wakeup of the \
waiting<br>thread in that time window, causing it to miss both the set flag and \
the<br>thread resumption.<br><br>Use a condition variable instead.<br><br>Fixes \
#13081.<br>---<br>M headers/private/kernel/thread_types.h<br>M \
src/system/kernel/image.cpp<br>M src/system/kernel/team.cpp<br>3 files changed, 12 \
insertions(+), 16 deletions(-)<br><br></pre><pre style="font-family: \
monospace,monospace; white-space: pre-wrap;">git pull ssh://git.haiku-os.org/haiku \
refs/changes/03/803/1</pre><p>To view, visit <a \
href="https://review.haiku-os.org/803">change 803</a>. To unsubscribe, or for help \
writing mail filters, visit <a \
href="https://review.haiku-os.org/settings">settings</a>.</p><div itemscope \
itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" \
itemtype="http://schema.org/ViewAction"><link itemprop="url" \
href="https://review.haiku-os.org/803"/><meta itemprop="name" content="View \
Change"/></div></div>

<div style="display:none"> Gerrit-Project: haiku </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: \
I93c45db8dd773fe42b45c4b67153bcd39e200d3b </div> <div style="display:none"> \
Gerrit-Change-Number: 803 </div> <div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Michael Lotz &lt;mmlr@mlotz.ch&gt; </div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic