summaryrefslogtreecommitdiff
path: root/Libraries/LibThread
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-30 11:43:25 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-30 11:43:25 +0200
commit888e35f0fed393e8496414e5c285cf4ca4788f67 (patch)
treeaa88e2b38bcb7cbb82adb0c0420401b7cb19dcf0 /Libraries/LibThread
parentf1a8fb1e88f902c9af2f1b18e6375c0b75f7e711 (diff)
downloadserenity-888e35f0fed393e8496414e5c285cf4ca4788f67.zip
AK: Add ALWAYS_INLINE, NEVER_INLINE and FLATTEN macros
It's tedious to write (and look at) [[gnu::always_inline]] etc. :^)
Diffstat (limited to 'Libraries/LibThread')
-rw-r--r--Libraries/LibThread/Lock.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/Libraries/LibThread/Lock.h b/Libraries/LibThread/Lock.h
index dd3b6e55f1..def18517ab 100644
--- a/Libraries/LibThread/Lock.h
+++ b/Libraries/LibThread/Lock.h
@@ -50,20 +50,20 @@ private:
class Locker {
public:
- [[gnu::always_inline]] inline explicit Locker(Lock& l)
+ ALWAYS_INLINE explicit Locker(Lock& l)
: m_lock(l)
{
lock();
}
- [[gnu::always_inline]] inline ~Locker() { unlock(); }
- [[gnu::always_inline]] inline void unlock() { m_lock.unlock(); }
- [[gnu::always_inline]] inline void lock() { m_lock.lock(); }
+ ALWAYS_INLINE ~Locker() { unlock(); }
+ ALWAYS_INLINE void unlock() { m_lock.unlock(); }
+ ALWAYS_INLINE void lock() { m_lock.lock(); }
private:
Lock& m_lock;
};
-[[gnu::always_inline]] inline void Lock::lock()
+ALWAYS_INLINE void Lock::lock()
{
int tid = gettid();
if (m_holder == tid) {