static fd_handler_h phandler;
static bool block_control = false;
static bool block_boot = false;
+static pthread_mutex_t pipe_mutex = PTHREAD_MUTEX_INITIALIZER;
/* Assume there is only one physical internal storage */
static int dev_internal = -1;
get_operation_char(pdata.op, name, sizeof(name)),
pdata.bdev, pdata.result);
+ // Multi thread should not write at the same time
+ pthread_mutex_lock(&pipe_mutex);
n = write(pfds[1], &pdata, sizeof(struct pipe_data));
+ pthread_mutex_unlock(&pipe_mutex);
return (n != sizeof(struct pipe_data)) ? -EPERM : 0;
}