Index: uspace/libc/generic/io/io.c
===================================================================
--- uspace/libc/generic/io/io.c	(revision 69e9dd2f7155aa5c481a39cd38d3d9bc2e03423b)
+++ uspace/libc/generic/io/io.c	(revision 3dbe2d1f2cf929c94b37e1ae26508eaac53ad4f6)
@@ -38,16 +38,15 @@
 #include <io/io.h>
 
-static char nl = '\n';
+const static char nl = '\n';
 
-int puts(const char * str)
+int puts(const char *str)
 {
 	size_t count;
 	
-	if (str == NULL) {
-		return putnchars("(NULL)",6 );
-	}
+	if (str == NULL)
+		return putnchars("(NULL)", 6);
 	
 	for (count = 0; str[count] != 0; count++);
-	if (write(1, (void * ) str, count) == count) {
+	if (write(1, (void *) str, count) == count) {
 		if (write(1, &nl, 1) == 1)
 			return 0;
@@ -62,9 +61,8 @@
  * @return 0 on succes, EOF on fail
  */
-int putnchars(const char * buf, size_t count)
+int putnchars(const char *buf, size_t count)
 {
-	if (write(1, (void * ) buf, count) == count) {
+	if (write(1, (void *) buf, count) == count)
 			return 0;
-	}
 	
 	return EOF;
@@ -74,16 +72,14 @@
  *
  */
-int putstr(const char * str)
+int putstr(const char *str)
 {
 	size_t count;
 	
-	if (str == NULL) {
-		return putnchars("(NULL)",6 );
-	}
+	if (str == NULL)
+		return putnchars("(NULL)", 6);
 
 	for (count = 0; str[count] != 0; count++);
-	if (write(1, (void * ) str, count) == count) {
+	if (write(1, (void *) str, count) == count)
 			return 0;
-	}
 	
 	return EOF;
@@ -93,7 +89,6 @@
 {
 	unsigned char ch = c;
-	if (write(1, (void *)&ch , 1) == 1) {
+	if (write(1, (void *) &ch, 1) == 1)
 			return c;
-	}
 	
 	return EOF;
@@ -103,7 +98,6 @@
 {
 	unsigned char c;
-	if (read(0, (void *)&c , 1) == 1) {
+	if (read(0, (void *) &c, 1) == 1)
 			return c;
-	}
 	
 	return EOF;
Index: uspace/libc/generic/io/printf.c
===================================================================
--- uspace/libc/generic/io/printf.c	(revision 69e9dd2f7155aa5c481a39cd38d3d9bc2e03423b)
+++ uspace/libc/generic/io/printf.c	(revision 3dbe2d1f2cf929c94b37e1ae26508eaac53ad4f6)
@@ -57,4 +57,2 @@
 /** @}
  */
- 
- 
Index: uspace/libc/generic/io/printf_core.c
===================================================================
--- uspace/libc/generic/io/printf_core.c	(revision 69e9dd2f7155aa5c481a39cd38d3d9bc2e03423b)
+++ uspace/libc/generic/io/printf_core.c	(revision 3dbe2d1f2cf929c94b37e1ae26508eaac53ad4f6)
@@ -41,6 +41,4 @@
 #include <ctype.h>
 #include <string.h>
-/* For serialization */
-#include <async.h>
 
 #define __PRINTF_FLAG_PREFIX		0x00000001	/**< show prefixes 0x or 0*/
@@ -93,13 +91,11 @@
 	size_t count;
 	
-	if (str == NULL) {
+	if (str == NULL)
 		return printf_putnchars("(NULL)", 6, ps);
-	}
 
 	for (count = 0; str[count] != 0; count++);
 
-	if (ps->write((void *) str, count, ps->data) == count) {
+	if (ps->write((void *) str, count, ps->data) == count)
 		return 0;
-	}
 	
 	return EOF;
@@ -448,7 +444,4 @@
 	uint64_t flags;
 	
-	/* Don't let other threads interfere */
-	async_serialize_start();
-
 	counter = 0;
 	
@@ -682,8 +675,6 @@
 	}
 	
-	async_serialize_end();
 	return counter;
 minus_out:
-	async_serialize_end();
 	return -counter;
 }
Index: uspace/libc/generic/io/vprintf.c
===================================================================
--- uspace/libc/generic/io/vprintf.c	(revision 69e9dd2f7155aa5c481a39cd38d3d9bc2e03423b)
+++ uspace/libc/generic/io/vprintf.c	(revision 3dbe2d1f2cf929c94b37e1ae26508eaac53ad4f6)
@@ -37,8 +37,9 @@
 #include <unistd.h>
 #include <io/printf_core.h>
+#include <futex.h>
 
-int vprintf_write(const char *str, size_t count, void *unused);
+atomic_t printf_futex = FUTEX_INITIALIZER;
 
-int vprintf_write(const char *str, size_t count, void *unused)
+static int vprintf_write(const char *str, size_t count, void *unused)
 {
 	return write(1, str, count);
@@ -52,7 +53,11 @@
 int vprintf(const char *fmt, va_list ap)
 {
-	struct printf_spec ps = {(int(*)(void *, size_t, void *))vprintf_write, NULL};
-	return printf_core(fmt, &ps, ap);
-
+	struct printf_spec ps = {(int(*)(void *, size_t, void *)) vprintf_write, NULL};
+	
+	futex_down(&printf_futex);
+	int ret = printf_core(fmt, &ps, ap);
+	futex_up(&printf_futex);
+	
+	return ret;
 }
 
Index: uspace/libc/generic/io/vsnprintf.c
===================================================================
--- uspace/libc/generic/io/vsnprintf.c	(revision 69e9dd2f7155aa5c481a39cd38d3d9bc2e03423b)
+++ uspace/libc/generic/io/vsnprintf.c	(revision 3dbe2d1f2cf929c94b37e1ae26508eaac53ad4f6)
@@ -44,6 +44,4 @@
 };
 
-int vsnprintf_write(const char *str, size_t count, struct vsnprintf_data *data);
-
 /** Write string to given buffer.
  * Write at most data->size characters including trailing zero. According to C99 has snprintf to return number
@@ -56,5 +54,5 @@
  * @return number of characters to print (not characters really printed!)
  */
-int vsnprintf_write(const char *str, size_t count, struct vsnprintf_data *data)
+static int vsnprintf_write(const char *str, size_t count, struct vsnprintf_data *data)
 {
 	size_t i;
@@ -98,5 +96,5 @@
 {
 	struct vsnprintf_data data = {size, 0, str};
-	struct printf_spec ps = {(int(*)(void *, size_t, void *))vsnprintf_write, &data};
+	struct printf_spec ps = {(int(*)(void *, size_t, void *)) vsnprintf_write, &data};
 
 	/* Print 0 at end of string - fix the case that nothing will be printed */
Index: uspace/libc/generic/io/vsprintf.c
===================================================================
--- uspace/libc/generic/io/vsprintf.c	(revision 69e9dd2f7155aa5c481a39cd38d3d9bc2e03423b)
+++ uspace/libc/generic/io/vsprintf.c	(revision 3dbe2d1f2cf929c94b37e1ae26508eaac53ad4f6)
@@ -45,5 +45,5 @@
 int vsprintf(char *str, const char *fmt, va_list ap)
 {
-	return vsnprintf(str, (size_t)-1, fmt, ap);
+	return vsnprintf(str, (size_t) - 1, fmt, ap);
 }
 
Index: uspace/libc/include/async.h
===================================================================
--- uspace/libc/include/async.h	(revision 69e9dd2f7155aa5c481a39cd38d3d9bc2e03423b)
+++ uspace/libc/include/async.h	(revision 3dbe2d1f2cf929c94b37e1ae26508eaac53ad4f6)
@@ -117,5 +117,5 @@
 		 ipcarg_t arg3);
 void async_msg_2(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2);
-#define async_msg(ph,m,a1) async_msg_2(ph,m,a1,0)
+#define async_msg(ph, m, a1) async_msg_2(ph, m, a1, 0)
 
 static inline void async_serialize_start(void)
@@ -123,4 +123,5 @@
 	psthread_inc_sercount();
 }
+
 static inline void async_serialize_end(void)
 {
