summaryrefslogtreecommitdiff
path: root/accel-pppd/triton/triton.h
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2017-10-12 17:09:41 +0300
committerDmitry Kozlov <xeb@mail.ru>2017-10-12 18:47:12 +0300
commitae48a9d61cafaee49fd1936e83e0e919dec5fa2d (patch)
treeb74f3f250c35c799047647f2a62d4dd401a99120 /accel-pppd/triton/triton.h
parent7be5b657cd57f61971680087e606f36e36605144 (diff)
downloadaccel-ppp-ae48a9d61cafaee49fd1936e83e0e919dec5fa2d.tar.gz
accel-ppp-ae48a9d61cafaee49fd1936e83e0e919dec5fa2d.zip
triton: rewrited context sleeping implementation
Instead of entering working thread into sleep triton saves machine context and stack on sleep and restores context/stack on wakeup. This saves costly new thread allocation.
Diffstat (limited to 'accel-pppd/triton/triton.h')
-rw-r--r--accel-pppd/triton/triton.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/accel-pppd/triton/triton.h b/accel-pppd/triton/triton.h
index b66737cf..79bbee1b 100644
--- a/accel-pppd/triton/triton.h
+++ b/accel-pppd/triton/triton.h
@@ -138,6 +138,8 @@ void triton_terminate(void);
#define __export __attribute__((visibility("default")))
#define __unused __attribute__((unused))
+#define barrier() asm volatile ("" ::: "memory")
+
#undef offsetof
#ifdef __compiler_offsetof
#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)