summaryrefslogtreecommitdiff
path: root/Libraries/LibThread
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2020-08-09 01:08:24 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-10 11:51:45 +0200
commitbee08a4b9ff0f2c269a4e3a8159b689fbb8d1ab8 (patch)
tree7963eede850be6fcf18ac8b3aae30e72a8d30407 /Libraries/LibThread
parent7bdf54c8372d6951409fae17dd4cec7eea6573a2 (diff)
downloadserenity-bee08a4b9ff0f2c269a4e3a8159b689fbb8d1ab8.zip
Kernel: More PID/TID typing
Diffstat (limited to 'Libraries/LibThread')
-rw-r--r--Libraries/LibThread/Lock.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Libraries/LibThread/Lock.h b/Libraries/LibThread/Lock.h
index 4fe0bb88f5..b6a82c42a2 100644
--- a/Libraries/LibThread/Lock.h
+++ b/Libraries/LibThread/Lock.h
@@ -44,7 +44,7 @@ public:
void unlock();
private:
- Atomic<int> m_holder { 0 };
+ Atomic<pid_t> m_holder { 0 };
u32 m_level { 0 };
};
@@ -65,14 +65,14 @@ private:
ALWAYS_INLINE void Lock::lock()
{
- int tid = gettid();
+ pid_t tid = gettid();
if (m_holder == tid) {
++m_level;
return;
}
for (;;) {
int expected = 0;
- if (m_holder.compare_exchange_strong(expected, tid, AK::memory_order_acq_rel)) {
+ if (m_holder.compare_exchange_strong(expected, tid, AK::memory_order_acq_rel)) {
m_level = 1;
return;
}