Index: uspace/app/rcubench/rcubench.c
===================================================================
--- uspace/app/rcubench/rcubench.c	(revision c124c985b458abc83183812eb63cef12f08694dd)
+++ uspace/app/rcubench/rcubench.c	(revision 38d8849c5dae9664aadfb5dfe635e66fd4bcb908)
@@ -40,5 +40,4 @@
 #include <mem.h>
 #include <errno.h>
-#include <thread.h>
 #include <assert.h>
 #include <async.h>
@@ -105,5 +104,5 @@
 }
 
-static void thread_func(void *arg)
+static errno_t thread_func(void *arg)
 {
 	bench_t *bench = (bench_t *)arg;
@@ -113,4 +112,5 @@
 	/* Signal another thread completed. */
 	futex_up(&bench->done_threads);
+	return EOK;
 }
 
@@ -123,14 +123,15 @@
 	}
 
+	fibril_test_spawn_runners(bench->nthreads - 1);
+
 	/* Create and run the first nthreads - 1 threads.*/
 	for (size_t k = 1; k < bench->nthreads; ++k) {
-		thread_id_t tid;
-		/* Also sets up a fibril for the thread. */
-		errno_t ret = thread_create(thread_func, bench, "rcubench-t", &tid);
-		if (ret != EOK) {
+		fid_t f = fibril_create(thread_func, bench);
+		if (!f) {
 			printf("Error: Failed to create benchmark thread.\n");
 			abort();
 		}
-		thread_detach(tid);
+		fibril_detach(f);
+		fibril_add_ready(f);
 	}
 
Index: uspace/app/rcutest/rcutest.c
===================================================================
--- uspace/app/rcutest/rcutest.c	(revision c124c985b458abc83183812eb63cef12f08694dd)
+++ uspace/app/rcutest/rcutest.c	(revision 38d8849c5dae9664aadfb5dfe635e66fd4bcb908)
@@ -41,5 +41,4 @@
 #include <mem.h>
 #include <errno.h>
-#include <thread.h>
 #include <assert.h>
 #include <async.h>
@@ -759,32 +758,9 @@
 /*--------------------------------------------------------------------*/
 
-static FIBRIL_MUTEX_INITIALIZE(blocking_mtx);
-
-static void dummy_fibril(void *arg)
-{
-	/* Block on an already locked mutex - enters the fibril manager. */
-	fibril_mutex_lock(&blocking_mtx);
-	assert(false);
-}
-
 static bool create_threads(size_t cnt)
 {
 	/* Sanity check. */
 	assert(cnt < 1024);
-
-	/* Keep this mutex locked so that dummy fibrils never exit. */
-	bool success = fibril_mutex_trylock(&blocking_mtx);
-	assert(success);
-
-	for (size_t k = 0; k < cnt; ++k) {
-		thread_id_t tid;
-
-		errno_t ret = thread_create(dummy_fibril, NULL, "urcu-test-worker", &tid);
-		if (EOK != ret) {
-			printf("Failed to create thread '%zu' (error: %s)\n", k + 1, str_error_name(ret));
-			return false;
-		}
-	}
-
+	fibril_test_spawn_runners(cnt);
 	return true;
 }
Index: uspace/app/tester/float/float1.c
===================================================================
--- uspace/app/tester/float/float1.c	(revision c124c985b458abc83183812eb63cef12f08694dd)
+++ uspace/app/tester/float/float1.c	(revision 38d8849c5dae9664aadfb5dfe635e66fd4bcb908)
@@ -33,5 +33,6 @@
 #include <stddef.h>
 #include <atomic.h>
-#include <thread.h>
+#include <fibril.h>
+#include <fibril_synch.h>
 #include <inttypes.h>
 #include "../tester.h"
@@ -43,8 +44,8 @@
 #define PRECISION  100000000
 
-static atomic_t threads_finished;
+static FIBRIL_SEMAPHORE_INITIALIZE(threads_finished, 0);
 static atomic_t threads_fault;
 
-static void e(void *data)
+static errno_t e(void *data)
 {
 	for (unsigned int i = 0; i < ATTEMPTS; i++) {
@@ -64,5 +65,6 @@
 	}
 
-	atomic_inc(&threads_finished);
+	fibril_semaphore_up(&threads_finished);
+	return EOK;
 }
 
@@ -71,13 +73,16 @@
 	atomic_count_t total = 0;
 
-	atomic_set(&threads_finished, 0);
 	atomic_set(&threads_fault, 0);
+	fibril_test_spawn_runners(THREADS);
 
 	TPRINTF("Creating threads");
 	for (unsigned int i = 0; i < THREADS; i++) {
-		if (thread_create(e, NULL, "e", NULL) != EOK) {
+		fid_t f = fibril_create(e, NULL);
+		if (!f) {
 			TPRINTF("\nCould not create thread %u\n", i);
 			break;
 		}
+		fibril_detach(f);
+		fibril_add_ready(f);
 
 		TPRINTF(".");
@@ -87,8 +92,7 @@
 	TPRINTF("\n");
 
-	while (atomic_get(&threads_finished) < total) {
-		TPRINTF("Threads left: %" PRIua "\n",
-		    total - atomic_get(&threads_finished));
-		thread_sleep(1);
+	for (unsigned int i = 0; i < total; i++) {
+		TPRINTF("Threads left: %" PRIua "\n", total - i);
+		fibril_semaphore_down(&threads_finished);
 	}
 
Index: uspace/app/tester/thread/thread1.c
===================================================================
--- uspace/app/tester/thread/thread1.c	(revision c124c985b458abc83183812eb63cef12f08694dd)
+++ uspace/app/tester/thread/thread1.c	(revision 38d8849c5dae9664aadfb5dfe635e66fd4bcb908)
@@ -33,5 +33,6 @@
 #include <atomic.h>
 #include <errno.h>
-#include <thread.h>
+#include <fibril.h>
+#include <fibril_synch.h>
 #include <stdio.h>
 #include <stddef.h>
@@ -40,14 +41,16 @@
 
 static atomic_t finish;
-static atomic_t threads_finished;
 
-static void threadtest(void *data)
+static FIBRIL_SEMAPHORE_INITIALIZE(threads_finished, 0);
+
+static errno_t threadtest(void *data)
 {
-	thread_detach(thread_get_id());
+	fibril_detach(fibril_get_id());
 
 	while (atomic_get(&finish))
-		thread_usleep(100000);
+		fibril_usleep(100000);
 
-	atomic_inc(&threads_finished);
+	fibril_semaphore_up(&threads_finished);
+	return EOK;
 }
 
@@ -58,12 +61,15 @@
 
 	atomic_set(&finish, 1);
-	atomic_set(&threads_finished, 0);
+
+	fibril_test_spawn_runners(THREADS);
 
 	TPRINTF("Creating threads");
 	for (i = 0; i < THREADS; i++) {
-		if (thread_create(threadtest, NULL, "threadtest", NULL) != EOK) {
+		fid_t f = fibril_create(threadtest, NULL);
+		if (!f) {
 			TPRINTF("\nCould not create thread %u\n", i);
 			break;
 		}
+		fibril_add_ready(f);
 		TPRINTF(".");
 		total++;
@@ -71,12 +77,12 @@
 
 	TPRINTF("\nRunning threads for %u seconds...", DELAY);
-	thread_sleep(DELAY);
+	fibril_sleep(DELAY);
 	TPRINTF("\n");
 
 	atomic_set(&finish, 0);
-	while (atomic_get(&threads_finished) < total) {
+	for (i = 0; i < total; i++) {
 		TPRINTF("Threads left: %" PRIua "\n",
-		    total - atomic_get(&threads_finished));
-		thread_sleep(1);
+		    total - i);
+		fibril_semaphore_down(&threads_finished);
 	}
 
Index: uspace/lib/c/arch/arm32/include/libarch/fibril.h
===================================================================
--- uspace/lib/c/arch/arm32/include/libarch/fibril.h	(revision c124c985b458abc83183812eb63cef12f08694dd)
+++ uspace/lib/c/arch/arm32/include/libarch/fibril.h	(revision 38d8849c5dae9664aadfb5dfe635e66fd4bcb908)
@@ -39,5 +39,4 @@
 #include <types/common.h>
 #include <align.h>
-#include <thread.h>
 #include <libarch/fibril_context.h>
 
Index: uspace/lib/c/generic/fibril.c
===================================================================
--- uspace/lib/c/generic/fibril.c	(revision c124c985b458abc83183812eb63cef12f08694dd)
+++ uspace/lib/c/generic/fibril.c	(revision 38d8849c5dae9664aadfb5dfe635e66fd4bcb908)
@@ -36,5 +36,4 @@
 #include <adt/list.h>
 #include <fibril.h>
-#include <thread.h>
 #include <stack.h>
 #include <tls.h>
@@ -49,4 +48,5 @@
 #include <async.h>
 
+#include "private/thread.h"
 #include "private/fibril.h"
 
Index: uspace/lib/c/generic/private/thread.h
===================================================================
--- uspace/lib/c/generic/private/thread.h	(revision c124c985b458abc83183812eb63cef12f08694dd)
+++ uspace/lib/c/generic/private/thread.h	(revision 38d8849c5dae9664aadfb5dfe635e66fd4bcb908)
@@ -36,8 +36,18 @@
 #define LIBC_PRIVATE_THREAD_H_
 
+#include <time.h>
 #include <abi/proc/uarg.h>
+#include <libarch/thread.h>
+#include <abi/proc/thread.h>
 
 extern void __thread_entry(void);
 extern void __thread_main(uspace_arg_t *);
+
+extern errno_t thread_create(void (*)(void *), void *, const char *, thread_id_t *);
+extern void thread_exit(int) __attribute__((noreturn));
+extern void thread_detach(thread_id_t);
+extern thread_id_t thread_get_id(void);
+extern int thread_usleep(useconds_t);
+extern unsigned int thread_sleep(unsigned int);
 
 #endif
Index: uspace/lib/c/generic/rcu.c
===================================================================
--- uspace/lib/c/generic/rcu.c	(revision c124c985b458abc83183812eb63cef12f08694dd)
+++ uspace/lib/c/generic/rcu.c	(revision 38d8849c5dae9664aadfb5dfe635e66fd4bcb908)
@@ -80,5 +80,4 @@
 #include <assert.h>
 #include <time.h>
-#include <thread.h>
 
 #include "private/fibril.h"
Index: uspace/lib/c/generic/stats.c
===================================================================
--- uspace/lib/c/generic/stats.c	(revision c124c985b458abc83183812eb63cef12f08694dd)
+++ uspace/lib/c/generic/stats.c	(revision 38d8849c5dae9664aadfb5dfe635e66fd4bcb908)
@@ -184,31 +184,4 @@
 }
 
-/** Get single thread statistics
- *
- * @param thread_id Thread ID we are interested in.
- *
- * @return Pointer to the stats_thread_t structure.
- *         If non-NULL then it should be eventually freed
- *         by free().
- *
- */
-stats_thread_t *stats_get_thread(thread_id_t thread_id)
-{
-	char name[SYSINFO_STATS_MAX_PATH];
-	snprintf(name, SYSINFO_STATS_MAX_PATH, "system.threads.%" PRIu64, thread_id);
-
-	size_t size = 0;
-	stats_thread_t *stats_thread =
-	    (stats_thread_t *) sysinfo_get_data(name, &size);
-
-	if (size != sizeof(stats_thread_t)) {
-		if (stats_thread != NULL)
-			free(stats_thread);
-		return NULL;
-	}
-
-	return stats_thread;
-}
-
 /** Get exception statistics.
  *
Index: uspace/lib/c/generic/thread.c
===================================================================
--- uspace/lib/c/generic/thread.c	(revision c124c985b458abc83183812eb63cef12f08694dd)
+++ uspace/lib/c/generic/thread.c	(revision 38d8849c5dae9664aadfb5dfe635e66fd4bcb908)
@@ -33,5 +33,4 @@
  */
 
-#include <thread.h>
 #include <libc.h>
 #include <stdbool.h>
@@ -159,17 +158,4 @@
 }
 
-/** Join thread.
- *
- * Currently not implemented.
- *
- * @param thread TID.
- *
- * @return Thread exit status.
- */
-errno_t thread_join(thread_id_t thread)
-{
-	return 0;
-}
-
 /** Get current thread ID.
  *
Index: uspace/lib/c/include/stats.h
===================================================================
--- uspace/lib/c/include/stats.h	(revision c124c985b458abc83183812eb63cef12f08694dd)
+++ uspace/lib/c/include/stats.h	(revision 38d8849c5dae9664aadfb5dfe635e66fd4bcb908)
@@ -37,5 +37,4 @@
 
 #include <task.h>
-#include <thread.h>
 #include <stdint.h>
 #include <stdbool.h>
@@ -53,5 +52,4 @@
 
 extern stats_thread_t *stats_get_threads(size_t *);
-extern stats_thread_t *stats_get_thread(thread_id_t);
 
 extern stats_exc_t *stats_get_exceptions(size_t *);
Index: pace/lib/c/include/thread.h
===================================================================
--- uspace/lib/c/include/thread.h	(revision c124c985b458abc83183812eb63cef12f08694dd)
+++ 	(revision )
@@ -1,55 +1,0 @@
-/*
- * Copyright (c) 2006 Jakub Jermar
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_THREAD_H_
-#define LIBC_THREAD_H_
-
-#include <errno.h>
-#include <libarch/thread.h>
-#include <stdint.h>
-#include <abi/proc/thread.h>
-#include <time.h>
-
-extern errno_t thread_create(void (*)(void *), void *, const char *, thread_id_t *);
-extern void thread_exit(int) __attribute__((noreturn));
-extern void thread_detach(thread_id_t);
-extern errno_t thread_join(thread_id_t);
-extern thread_id_t thread_get_id(void);
-extern int thread_usleep(useconds_t);
-extern unsigned int thread_sleep(unsigned int);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/pcut/tests/timeout.c
===================================================================
--- uspace/lib/pcut/tests/timeout.c	(revision c124c985b458abc83183812eb63cef12f08694dd)
+++ uspace/lib/pcut/tests/timeout.c	(revision 38d8849c5dae9664aadfb5dfe635e66fd4bcb908)
@@ -30,5 +30,5 @@
 
 #ifdef __helenos__
-#include <thread.h>
+#include <fibril.h>
 #else
 #ifdef __unix
@@ -46,5 +46,5 @@
 {
 #ifdef __helenos__
-	thread_sleep(sec);
+	fibril_sleep(sec);
 #else
 #ifdef __unix
Index: uspace/lib/posix/include/posix/pthread.h
===================================================================
--- uspace/lib/posix/include/posix/pthread.h	(revision c124c985b458abc83183812eb63cef12f08694dd)
+++ uspace/lib/posix/include/posix/pthread.h	(revision 38d8849c5dae9664aadfb5dfe635e66fd4bcb908)
@@ -33,8 +33,7 @@
 #define POSIX_PTHREAD_H_
 
-#include "libc/thread.h"
 #include "time.h"
 
-typedef thread_id_t pthread_t;
+typedef void *pthread_t;
 
 typedef struct {
Index: uspace/lib/posix/src/pthread/threads.c
===================================================================
--- uspace/lib/posix/src/pthread/threads.c	(revision c124c985b458abc83183812eb63cef12f08694dd)
+++ uspace/lib/posix/src/pthread/threads.c	(revision 38d8849c5dae9664aadfb5dfe635e66fd4bcb908)
@@ -36,10 +36,10 @@
 #include "errno.h"
 #include "posix/stdlib.h"
-#include "libc/thread.h"
+#include <fibril.h>
 #include "../internal/common.h"
 
 pthread_t pthread_self(void)
 {
-	return thread_get_id();
+	return (pthread_t) fibril_get_id();
 }
 
Index: uspace/lib/posix/src/unistd.c
===================================================================
--- uspace/lib/posix/src/unistd.c	(revision c124c985b458abc83183812eb63cef12f08694dd)
+++ uspace/lib/posix/src/unistd.c	(revision 38d8849c5dae9664aadfb5dfe635e66fd4bcb908)
@@ -45,5 +45,4 @@
 
 #include "libc/task.h"
-#include "libc/thread.h"
 #include "libc/stats.h"
 #include "libc/malloc.h"
@@ -70,5 +69,6 @@
 unsigned int sleep(unsigned int seconds)
 {
-	return thread_sleep(seconds);
+	fibril_sleep(seconds);
+	return 0;
 }
 
