Index: libc/generic/io/printf_core.c
===================================================================
--- libc/generic/io/printf_core.c	(revision 63bb83ed7412a460e79d7f86131e182f7bdc3040)
+++ libc/generic/io/printf_core.c	(revision 0d11fc1c2fef919272b994e2ea9e695ba40a9070)
@@ -38,4 +38,6 @@
 #include <ctype.h>
 #include <string.h>
+/* For serialization */
+#include <async.h>
 
 #define __PRINTF_FLAG_PREFIX		0x00000001	/**< show prefixes 0x or 0*/
@@ -445,4 +447,7 @@
 	uint64_t flags;
 	
+	/* Don't let other threads interfere */
+	async_serialize_start();
+
 	counter = 0;
 	
@@ -453,5 +458,5 @@
 			if (i > j) {
 				if ((retval = printf_putnchars(&fmt[j], (size_t)(i - j), ps)) == EOF) { /* error */
-					return -counter;
+					goto minus_out;
 				}
 				counter += retval;
@@ -549,5 +554,5 @@
 				case 's':
 					if ((retval = print_string(va_arg(ap, char*), width, precision, flags, ps)) == EOF) {
-						return -counter;
+						goto minus_out;
 					};
 					
@@ -558,5 +563,5 @@
 					c = va_arg(ap, unsigned int);
 					if ((retval = print_char(c, width, flags, ps)) == EOF) {
-						return -counter;
+						goto minus_out;
 					};
 					
@@ -639,5 +644,5 @@
 					break;
 				default: /* Unknown qualifier */
-					return -counter;
+					goto minus_out;
 					
 			}
@@ -658,5 +663,5 @@
 
 			if ((retval = print_number(number, width, precision, base, flags, ps)) == EOF ) {
-				return -counter;
+				goto minus_out;
 			};
 
@@ -671,10 +676,14 @@
 	if (i > j) {
 		if ((retval = printf_putnchars(&fmt[j], (size_t)(i - j), ps)) == EOF) { /* error */
-			return -counter;
+			goto minus_out;
 		}
 		counter += retval;
 	}
 	
+	async_serialize_end();
 	return counter;
+minus_out:
+	async_serialize_end();
+	return -counter;
 }
 
