funlockfile()

unlock stdio (FILE *) object 

Function


SYNOPSIS

#include <stdio.h>

void funlockfile(FILE *file);


DESCRIPTION

The funlockfile() function provides explicit application-level locking of stdio (FILE *) objects. This function can be used by a thread to delineate a sequence of I/O statements that are to be executed as unit. The funlockfile() function is used to relinquish the ownership of file. Behavior is undefined if a thread other than the owner calls funlockfile().

Logically, there is a lock count associated with each (FILE *) object. This count is implicitly initialized to zero when the object is created. The object is unlocked when the count is zero. When the count is positive, a single thread owns the object. When flockfile() is called, if the count is zero or if the count is positive and the caller owns the object, the count is incremented. Otherwise, the calling thread is suspended, waiting for the count to return to zero. Each call to funlockfile() decrements the count. This allows matching calls to flockfile() and funlockfile() to be nested.

All functions that reference (FILE *) objects behave as if they use flockfile() and funlockfile() internally to obtain ownership of these objects, unless the documentation for the function explicitly indicates that the function operates on an unlocked object.


PARAMETERS

file 

Is the file object to be unlocked.


RETURN VALUES

None.


CONFORMANCE

POSIX.1 (1996).


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
fclose(), fdopen(), flockfile(), fopen(), ftrylockfile(), getc_unlocked(), getchar_unlocked(), putc_unlocked(), putchar_unlocked()


PTC MKS Toolkit 10.4 Documentation Build 39.