Skip to content

MTY_LockFileCreate

chrisd1100 edited this page Aug 25, 2022 · 1 revision

Create an MTY_LockFile for signaling resource ownership across processes.

The process that holds the lock will continue to hold the lock unil MTY_LockFileDestroy is called or the process terminates. The lock file will be created if it does not exist.

MTY_LockFile *MTY_LockFileCreate(
    const char * path,
    MTY_FileMode mode
);

Parameters

path (const char *)

Path to the lock file.

mode (MTY_FileMode)

Choose between exclusive or shared read access.

Return value

MTY_LockFile *

On failure, NULL is returned. Call MTY_GetLog for details.

The returned MTY_LockFile must be destroyed with MTY_LockFileDestroy.

Platform support

Windows   macOS   Android   Linux   Web  

See also

Module: File

Clone this wiki locally