Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


...

Code Block
languagecpp
void  fs_flockfile (FS_FILE  *p_file);

...

1109765
HTML Table
summary
classPlain_Table
Table Row (tr)
Table Cell (td)
Anchor
1109765


File

...

Called from

...

Code enabled by

...

fs_api

...

.c

...

...

Application

...

FS_CFG_API_EN and FS_CFG_FILE_LOCK_EN

...

10919291091929Acquire task ownership of a file. Anchor11046111104611

Arguments

...

1108444p_fileanchor11405601140560

Pointer to a file.

...

Returned Value

...

1091933None. Anchor11000091100009

Notes/Warnings

...

...

  1. A lock count is associated with each file:

...

    1. ...

        1. The file is unlocked when the lock count is zero.

      ...

        1. If the lock count is positive, a task owns the file.

      ...

      ...

        1. When fs_flockfile() is called, if…

      ...

          1. …the lock count is zero OR

      ...

      ...

          1. …the lock count is positive and the caller owns the file…

      ...

          1. …the lock count will be incremented and the caller will own the file. Otherwise, the caller will wait until the lock count returns to zero.

      ...

        1. Each call to fs_funlockfile() incremenets the lock count.

      ...

        1. Matching calls to fs_flockfile() (or fs_ftrylockfile()) and fs_funlockfile() can be nested.