Changes in uspace/lib/c/generic/io/vprintf.c [e08a733:369a5f8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/vprintf.c
re08a733 r369a5f8 37 37 #include <unistd.h> 38 38 #include <io/printf_core.h> 39 #include <f ibril_synch.h>39 #include <futex.h> 40 40 #include <async.h> 41 41 #include <str.h> 42 42 43 static FIBRIL_MUTEX_INITIALIZE(printf_mutex);43 static atomic_t printf_futex = FUTEX_INITIALIZER; 44 44 45 45 static int vprintf_str_write(const char *str, size_t size, void *stream) … … 85 85 * Prevent other threads to execute printf_core() 86 86 */ 87 fibril_mutex_lock(&printf_mutex); 87 futex_down(&printf_futex); 88 89 /* 90 * Prevent other fibrils of the same thread 91 * to execute printf_core() 92 */ 93 async_serialize_start(); 88 94 89 95 int ret = printf_core(fmt, &ps, ap); 90 96 91 fibril_mutex_unlock(&printf_mutex); 97 async_serialize_end(); 98 futex_up(&printf_futex); 92 99 93 100 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.