Changeset 10d6b858 in mainline for uspace/srv/vfs/vfs_rdwr.c


Ignore:
Timestamp:
2008-01-06T16:40:58Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
222e57c
Parents:
4db6eaf
Message:

Introduce the open file lock. Modify vfs_rdwr() to take this lock into account
when reading or writing from/to an open file.

File:
1 edited

Legend:

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

    r4db6eaf r10d6b858  
    8383
    8484        /*
     85         * Lock the open file structure so that no other thread can manipulate
     86         * the same open file at a time.
     87         */
     88        futex_down(&file->lock);
     89
     90        /*
    8591         * Lock the file's node so that no other client can read/write to it at
    8692         * the same time.
     
    127133
    128134        /*
    129          * Update the position pointer.
     135         * Update the position pointer and unlock the open file.
    130136         */
    131137        file->pos += bytes;
     138        futex_up(&file->lock);
    132139
    133140        /*
Note: See TracChangeset for help on using the changeset viewer.