File_SetDiskBusy

FMOD Studio API

Firelight Technologies FMOD Studio API

File_SetDiskBusy

Mutex function to synchronize user file reads with FMOD's file reads. This function tells fmod that you are using the disk so that it will block until you are finished with it.
This function also blocks if FMOD is already using the disk, so that you cannot do a read at the same time FMOD is reading.

C++ Syntax

FMOD_RESULT File_SetDiskBusy(
  int busy
);

C Syntax

FMOD_RESULT FMOD_File_SetDiskBusy(
  int busy
);

Parameters

busy

1 = you are about to perform a disk access. 0 = you are finished with the disk.

Return Values

If the function succeeds then the return value is FMOD_OK.
If the function fails then the return value will be one of the values defined in the FMOD_RESULT enumeration.

Remarks

Use this function as a wrapper around your own file reading functions if you want to do simulatenous file reading while FMOD is also reading. ie

FMOD_File_SetDiskBusy(1);
myfread(...);
FMOD_File_SetDiskBusy(0);

Warning! This is a critical section internally. If you do not match your busy = true with a busy = false your program may hang!
If you forget to set diskbusy to false it will stop FMOD from reading from the disk.

See Also




Version 1.10.03 Built on Feb 1, 2018