Index: init/init.c
===================================================================
--- init/init.c	(revision 4f2c8218fdbb360b9ab211233268fba256e95394)
+++ init/init.c	(revision 520492a919fe1fbbbca2ba14c75775dab9c6f60a)
@@ -256,13 +256,13 @@
 static int ptest(void *arg)
 {
-	printf("Pseudo thread-1\n");
-	ps_preempt();
-	printf("Pseudo thread-2\n");
-	ps_preempt();
-	printf("Pseudo thread-3\n");
-	ps_preempt();
-	printf("Pseudo thread-4\n");
-	ps_preempt();
-	printf("Pseudo finish\n");
+	printf("Pseudo thread stage1.\n");
+	psthread_schedule_next();
+	printf("Pseudo thread stage2.\n");
+	psthread_schedule_next();
+	printf("Pseudo thread stage3.\n");
+	psthread_schedule_next();
+	printf("Pseudo thread stage4.\n");
+	psthread_schedule_next();
+	printf("Pseudo thread exiting.\n");
 	return 0;	
 }
@@ -309,12 +309,11 @@
 
 	ptid = psthread_create(ptest, NULL);
-	printf("main thread-1\n");
-	ps_preempt();
-	printf("main thread-2\n");
-	ps_preempt();
-	printf("main thread-3\n");
-
-	ps_join(ptid);
-	printf("Main exiting\n");
+	printf("Main thread stage1.\n");
+	psthread_schedule_next();;
+	printf("Main thread stage2.\n");
+	psthread_schedule_next();;
+	printf("Main thread stage3.\n");
+
+	psthread_join(ptid);
 
 	printf("Main thread exiting.\n");
Index: libc/generic/psthread.c
===================================================================
--- libc/generic/psthread.c	(revision 4f2c8218fdbb360b9ab211233268fba256e95394)
+++ libc/generic/psthread.c	(revision 520492a919fe1fbbbca2ba14c75775dab9c6f60a)
@@ -37,10 +37,11 @@
 static LIST_INITIALIZE(ready_list);
 
-static void ps_exit(void) __attribute__ ((noinline));
+static void psthread_exit(void) __attribute__ ((noinline));
+static void psthread_main(void);
 
-/** Function to preempt to other thread without adding
- * currently running thread to runqueue
+/** Function to preempt to other pseudo thread without adding
+ * currently running pseudo thread to ready_list.
  */
-void ps_exit(void)
+void psthread_exit(void)
 {
 	psthread_data_t *pt;
@@ -51,11 +52,11 @@
 		_exit(0);
 	}
-	pt = list_get_instance(ready_list.next, psthread_data_t, list);
-	list_remove(&pt->list);
+	pt = list_get_instance(ready_list.next, psthread_data_t, link);
+	list_remove(&pt->link);
 	context_restore(&pt->ctx);
 }
 
 /** Function that is called on entry to new uspace thread */
-static int psthread_main(void)
+void psthread_main(void)
 {
 	psthread_data_t *pt = __tls_get();
@@ -64,11 +65,14 @@
 	pt->finished = 1;
 	if (pt->waiter)
-		list_append(&pt->waiter->list, &ready_list);
+		list_append(&pt->waiter->link, &ready_list);
 
-	ps_exit();
+	psthread_exit();
 }
 
-/** Do a preemption of userpace threads */
-int ps_preempt(void)
+/** Schedule next userspace pseudo thread.
+ *
+ * @return 0 if there is no ready pseudo thread, 1 otherwise.
+ */
+int psthread_schedule_next(void)
 {
 	psthread_data_t *pt;
@@ -78,16 +82,21 @@
 
 	pt = __tls_get();
-	if (! context_save(&pt->ctx))
+	if (!context_save(&pt->ctx))
 		return 1;
 	
-	list_append(&pt->list, &ready_list);
-	pt = list_get_instance(ready_list.next, psthread_data_t, list);
-	list_remove(&pt->list);
+	list_append(&pt->link, &ready_list);
+	pt = list_get_instance(ready_list.next, psthread_data_t, link);
+	list_remove(&pt->link);
 
 	context_restore(&pt->ctx);
 }
 
-/** Wait for uspace thread to finish */
-int ps_join(pstid_t psthrid)
+/** Wait for uspace pseudo thread to finish.
+ *
+ * @param psthrid Pseudo thread to wait for.
+ *
+ * @return Value returned by the finished thread.
+ */
+int psthread_join(pstid_t psthrid)
 {
 	volatile psthread_data_t *pt, *mypt;
@@ -102,5 +111,5 @@
 		if (context_save(&((psthread_data_t *) mypt)->ctx)) {
 			pt->waiter = (psthread_data_t *) mypt;
-			ps_exit();
+			psthread_exit();
 		}
 	}
@@ -114,6 +123,10 @@
 
 /**
- * Create a userspace thread
+ * Create a userspace thread and append it to ready list.
  *
+ * @param func Pseudo thread function.
+ * @param arg Argument to pass to func.
+ *
+ * @return 0 on failure, TLS of the new pseudo thread.
  */
 pstid_t psthread_create(int (*func)(void *), void *arg)
@@ -136,7 +149,6 @@
 	context_set(&pt->ctx, FADDR(psthread_main), pt->stack, getpagesize(), pt);
 
-	list_append(&pt->list, &ready_list);
+	list_append(&pt->link, &ready_list);
 
 	return (pstid_t )pt;
 }
-
Index: libc/include/psthread.h
===================================================================
--- libc/include/psthread.h	(revision 4f2c8218fdbb360b9ab211233268fba256e95394)
+++ libc/include/psthread.h	(revision 520492a919fe1fbbbca2ba14c75775dab9c6f60a)
@@ -45,5 +45,5 @@
 	struct psthread_data *self; /* ia32, amd64 needs to get self address */
 
-	link_t list;
+	link_t link;
 	context_t ctx;
 	void *stack;
@@ -62,6 +62,6 @@
 
 pstid_t psthread_create(int (*func)(void *), void *arg);
-int ps_preempt(void);
-int ps_join(pstid_t psthrid);
+int psthread_schedule_next(void);
+int psthread_join(pstid_t psthrid);
 
 #endif
