diff --git a/inc/lektor/thread.h b/inc/lektor/thread.h
index ac1f52ad6aab3e4c69913c1c699bfc91e252df1c..dcd3d75c23ede39f42f314ea098e04c1bb1a812b 100644
--- a/inc/lektor/thread.h
+++ b/inc/lektor/thread.h
@@ -1,7 +1,7 @@
 #pragma once
 
 #include <lektor/define.h>
-#include <mthread/mthread.h>
+#include <pthread.h>
 #include <sys/types.h>
 
 struct poller_thread {
@@ -9,16 +9,16 @@ struct poller_thread {
     volatile unsigned int input_len;
     volatile unsigned int input_size;
     volatile void *volatile *volatile input_cells;
-    mthread_mutex_t input_lock;
+    pthread_mutex_t input_lock;
 
-    mthread_t th;
+    pthread_t th;
     unsigned int initial_size;
 
     /* The output pool. */
     volatile unsigned int output_len;
     volatile unsigned int output_size;
     volatile void *volatile *volatile output_cells;
-    mthread_mutex_t output_lock;
+    pthread_mutex_t output_lock;
 };
 
 struct poller_thread_arg {
diff --git a/src/main/server.c b/src/main/server.c
index 3c12393aae955f437550038bf0100c1972d3d929..d7c00eed3905441f42d2eee46d4bd07861ed1c71 100644
--- a/src/main/server.c
+++ b/src/main/server.c
@@ -57,7 +57,7 @@ main(int argc, char *argv[])
 
 normal_launch:
     LOG_INFO("Lektor launched by user %s (shell: %s, home: %s)", pw->pw_name, pw->pw_shell, pw->pw_dir);
-    mthread_init();
+    // mthread_init();
 
     return lkt_listen();
 }
diff --git a/src/repo/async.c b/src/repo/async.c
index 0befc290a96332831bb553a1030b1498345242e9..aeeb98a4ed99c217a35448cbf93cdd8aa8d46efb 100644
--- a/src/repo/async.c
+++ b/src/repo/async.c
@@ -13,7 +13,7 @@
 
 static struct poller_thread repo_thread;
 
-static mthread_mutex_t mtx = MTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
 static volatile int init = 0;
 static volatile int stop = 0;
 static volatile int all_json = 0;
@@ -22,14 +22,14 @@ int
 repo_join_thread(void)
 {
     int ret = 1;
-    RETURN_IF(mthread_mutex_lock(&mtx), "Failed to lock mutex", 3);
+    RETURN_IF(pthread_mutex_lock(&mtx), "Failed to lock mutex", 3);
     GOTO_UNLESS(init, "Repo thread no launched, can't join", error);
     stop = 1;
-    GOTO_IF(mthread_join(repo_thread.th, NULL), "Failed to join repo thread", error);
+    GOTO_IF(pthread_join(repo_thread.th, NULL), "Failed to join repo thread", error);
     LOG_INFO("%s", "repo thread joined");
     ret = 0;
 error:
-    RETURN_IF(mthread_mutex_unlock(&mtx), "Failed to unlock mutex", 3);
+    RETURN_IF(pthread_mutex_unlock(&mtx), "Failed to unlock mutex", 3);
     return ret;
 }
 
@@ -113,7 +113,7 @@ __repo_thread_function(struct poller_thread_arg *arg)
     LOG_INFO("%s", "Starting the repo thread");
 
     for (;;) {
-        GOTO_IF(mthread_mutex_lock(&mtx), "Failed to lock mutex", end_loop);
+        GOTO_IF(pthread_mutex_lock(&mtx), "Failed to lock mutex", end_loop);
 
         if (all_json) {
             repo_get_alljson_sync(repo, &json);
@@ -122,7 +122,7 @@ __repo_thread_function(struct poller_thread_arg *arg)
         }
 
         if (stop) {
-            if (mthread_mutex_unlock(&mtx))
+            if (pthread_mutex_unlock(&mtx))
                 LOG_ERROR("Failed to unlock mutex: %s", strerror(errno));
             break;
         }
@@ -178,7 +178,7 @@ try_later:
             LOG_ERROR("%s", "Failed to get the head of the input list");
 
 end_loop:
-        mthread_yield();
+        sched_yield();
         sleep(1);
     }
 
@@ -226,8 +226,8 @@ err:
 inline int
 repo_get_allid_async(void)
 {
-    RETURN_IF(mthread_mutex_lock(&mtx), "Failed to lock mutex", 3);
+    RETURN_IF(pthread_mutex_lock(&mtx), "Failed to lock mutex", 3);
     all_json = 1;
-    RETURN_IF(mthread_mutex_unlock(&mtx), "Failed to lock mutex", 3);
+    RETURN_IF(pthread_mutex_unlock(&mtx), "Failed to lock mutex", 3);
     return 0;
 }
diff --git a/src/thread.c b/src/thread.c
index 31fe55592ad5e40cf9c553e12cf945c406c1575a..daa77b88c3344f03e6d927ca7bf2fd6f7a255f07 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -2,7 +2,7 @@
 
 #include <common/common.h>
 #include <lektor/thread.h>
-#include <mthread/mthread.h>
+#include <pthread.h>
 #include <sys/types.h>
 #include <stdlib.h>
 #include <errno.h>
@@ -29,8 +29,8 @@ int
 lkt_th_new(struct poller_thread *th, unsigned int init_sizes,
            void *(*func)(struct poller_thread_arg *), void *args)
 {
-    mthread_mutex_t mtx1 = MTHREAD_MUTEX_INITIALIZER;
-    mthread_mutex_t mtx2 = MTHREAD_MUTEX_INITIALIZER;
+    pthread_mutex_t mtx1 = PTHREAD_MUTEX_INITIALIZER;
+    pthread_mutex_t mtx2 = PTHREAD_MUTEX_INITIALIZER;
     struct poller_thread th_ = {
         .initial_size   = init_sizes,
         .input_lock     = mtx1,
@@ -52,7 +52,7 @@ lkt_th_new(struct poller_thread *th, unsigned int init_sizes,
     __args->arg = args;
     __args->arg->self = th;
 
-    if(!mthread_create(&(th->th), NULL, __start, __args)) {
+    if(!pthread_create(&(th->th), NULL, __start, __args)) {
         LOG_INFO_SCT("THREAD", "%s", "Create a new poller thread");
         return 0;
     }
@@ -75,7 +75,7 @@ out_of_memory:
 int
 lkt_th_join(struct poller_thread *th, void **ret)
 {
-    int sta = mthread_join(th->th, ret);
+    int sta = pthread_join(th->th, ret);
 
     if (sta)
         LOG_ERROR("%s", "Failed to join thread");
@@ -94,12 +94,12 @@ lkt_th_join(struct poller_thread *th, void **ret)
 
 static inline int
 th_append(unsigned int *len, unsigned int *size, void ***cells,
-          mthread_mutex_t *lock, void *ptr)
+          pthread_mutex_t *lock, void *ptr)
 {
     void *new;
     int ret = 0;
 
-    GOTO_IF(mthread_mutex_lock(lock), "Failed to lock", end);
+    GOTO_IF(pthread_mutex_lock(lock), "Failed to lock", end);
 
     if (*len == *size) {
         new = realloc((void *) *cells, (*len + *size) * sizeof(void *));
@@ -117,16 +117,16 @@ th_append(unsigned int *len, unsigned int *size, void ***cells,
     (*cells)[(*len)++] = ptr;
     ret = 0;
 end:
-    RETURN_IF(mthread_mutex_unlock(lock), "Failed to lock", 1);
+    RETURN_IF(pthread_mutex_unlock(lock), "Failed to lock", 1);
     return ret;
 }
 
 static inline int
-th_pop(unsigned int *len, void **cells, mthread_mutex_t *lock, void **ptr)
+th_pop(unsigned int *len, void **cells, pthread_mutex_t *lock, void **ptr)
 {
     int ret = 1;
 
-    GOTO_IF(mthread_mutex_lock(lock), "Failed to lock", end);
+    GOTO_IF(pthread_mutex_lock(lock), "Failed to lock", end);
 
     if (*len > 0)
         *ptr = cells[--(*len)];
@@ -135,15 +135,15 @@ th_pop(unsigned int *len, void **cells, mthread_mutex_t *lock, void **ptr)
 
     ret = 0;
 end:
-    RETURN_IF(mthread_mutex_unlock(lock), "Failed to lock", 1);
+    RETURN_IF(pthread_mutex_unlock(lock), "Failed to lock", 1);
     return ret;
 }
 
 static inline int
-th_head(unsigned int len, void **cells, mthread_mutex_t *lock, void **ptr)
+th_head(unsigned int len, void **cells, pthread_mutex_t *lock, void **ptr)
 {
     int ret = 1;
-    GOTO_IF(mthread_mutex_lock(lock), "Failed to lock", end);
+    GOTO_IF(pthread_mutex_lock(lock), "Failed to lock", end);
 
     if (len > 0)
         *ptr = cells[len - 1];
@@ -152,7 +152,7 @@ th_head(unsigned int len, void **cells, mthread_mutex_t *lock, void **ptr)
 
     ret = 0;
 end:
-    RETURN_IF(mthread_mutex_unlock(lock), "Failed to lock", 1);
+    RETURN_IF(pthread_mutex_unlock(lock), "Failed to lock", 1);
     return ret;
 }