Commit | Line | Data |
7df24e1f |
1 | ==================================== |
2 | SFmpq in multi-threaded applications |
3 | ==================================== |
4 | |
5 | A note about archive and file handles: In most cases, archive and file handles should not be shared between threads. Instead, open a new handle for each thread that will be reading from or writing to the archive or file. However, if no threads have direct access to the handle and only one is able to use the archive or file at a time, sharing handles can be done. Also, archive handles may be shared between threads when you are only reading files from the archive. |
6 | |
7 | ------------------------------- |
8 | Always nonthread-safe functions |
9 | ------------------------------- |
10 | SFileOpenFileAsArchive |
11 | SFileOpenArchive |
12 | SFileCloseArchive |
13 | SFileOpenFile |
14 | SFileOpenFileEx |
15 | SFileCloseFile |
16 | SFileSetLocale (same value is used for all threads, so changing it for one changes it for all) |
17 | SFileSetBasePath (should not be called at same time as itself or SFileGetBasePath, same value is used for all threads) |
18 | SFileSetArchivePriority |
19 | MpqOpenArchiveForUpdate |
20 | MpqCloseUpdatedArchive |
21 | MpqAddFileToArchiveEx |
22 | MpqAddFileToArchive |
23 | MpqAddWaveToArchive |
24 | MpqAddFileFromBufferEx |
25 | MpqAddFileFromBuffer |
26 | MpqAddWaveFromBuffer |
27 | MpqRenameFile |
28 | MpqRenameAndSetFileLocale |
29 | MpqDeleteFile |
30 | MpqDeleteFileWithLocale |
31 | MpqCompactArchive |
32 | MpqSetFileLocale |
33 | |
34 | ----------------------------------- |
35 | Conditionally thread-safe functions |
36 | ----------------------------------- |
37 | |
38 | Note: All file reading functions are thread-safe if separate handles are used for each thread and no functions are being used that would change the archive or files in any way. If an archive is opened with write access, no other thread should be able to open another handle to it. |
39 | |
40 | Should not be called while opening or closing archives or files |
41 | --------------------------------------------------------------- |
42 | SFileGetArchiveName |
43 | SFileGetFileName |
44 | SFileGetFileInfo |
45 | |
46 | Should not be called if the archive or file handle being used will be closed |
47 | ---------------------------------------------------------------------------- |
48 | SFileGetFileSize |
49 | SFileGetFileArchive |
50 | SFileSetFilePointer |
51 | SFileReadFile |
52 | SFileListFiles |
53 | SFileFindMpqHeader |
54 | |
55 | Other conditions |
56 | ---------------- |
57 | SFileGetBasePath (should not be called at same time as SFileSetBasePath) |
58 | |
59 | ---------------------------- |
60 | Always thread-safe functions |
61 | ---------------------------- |
62 | SFileDestroy |
63 | StormDestroy |
64 | SFMpqDestroy |
65 | MpqInitialize |
66 | MpqGetVersionString |
67 | MpqGetVersion |
68 | SFMpqGetVersionString |
69 | SFMpqGetVersionString2 |
70 | SFMpqGetVersion |
71 | AboutSFMpq |
72 | SFMpqCompareVersion |
73 | |