Changeset 81614543 in mainline


Ignore:
Timestamp:
2007-11-11T13:06:15Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7c5bcc0
Parents:
6c4ff8a
Message:

VFS work.
vfs_grab_phone() must disable fibril preemption in order to avoid deadlock with
other fibrils of the same thread that might be trying to vfs_grab_phone() too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs_register.c

    r6c4ff8a r81614543  
    3939#include <ipc/services.h>
    4040#include <async.h>
     41#include <fibril.h>
    4142#include <errno.h>
    4243#include <stdio.h>
     
    339340                         */
    340341                        futex_down(&fs->phone_futex);
     342                        /*
     343                         * Avoid deadlock with other fibrils in the same thread
     344                         * by disabling fibril preemption.
     345                         */
     346                        fibril_inc_sercount();
    341347                        return fs->phone;
    342348                }
     
    354360        bool found = false;
    355361
     362        /*
     363         * Undo the fibril_inc_sercount() done in vfs_grab_phone().
     364         */
     365        fibril_dec_sercount();
     366       
    356367        futex_down(&fs_head_futex);
    357368        link_t *cur;
Note: See TracChangeset for help on using the changeset viewer.