Skip to content
  • Alessandro Rubini's avatar
    chardev: add a per-channel mutex (TEMPORARY) · 7f1e7f77
    Alessandro Rubini authored
    
    
    This is a temporary solution to race conditions between user space
    programs acting on the same channel.  The code serializes all
    operations on a channel, to prevern chan->user_block to disappear
    while being used by another process.
    
    We keep the mutex when going to sleep, which means that only one
    process at a time can be sleeping on a cahnnel -- other processes
    will be sleeping on the semaphore, thus not obeying O_NONBLOCK.
    
    We'll try to do it more cleanly in master, but this al least fixes
    possible oopses in the currently installed systems.
    
    Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
    Acked-by: default avatarFederico Vaga <federico.vaga@gmail.com>
    7f1e7f77