Enable threading.
All checks were successful
The build was successful.

This commit is contained in:
2019-06-27 20:52:37 +02:00
parent 4881ddf6de
commit 3dcc908788
5 changed files with 3 additions and 126 deletions

View File

@@ -816,10 +816,8 @@ struct ph7 {
SyMemBackend sAllocator; /* Low level memory allocation subsystem */
const ph7_vfs *pVfs; /* Underlying Virtual File System */
ph7_conf xConf; /* Configuration */
#if defined(PH7_ENABLE_THREADS)
const SyMutexMethods *pMethods; /* Mutex methods */
SyMutex *pMutex; /* Per-engine mutex */
#endif
ph7_vm *pVms; /* List of active VM */
sxi32 iVm; /* Total number of active VM */
ph7 *pNext, *pPrev; /* List of active engines */
@@ -1195,9 +1193,7 @@ struct ph7_switch {
*/
struct ph7_vm {
SyMemBackend sAllocator; /* Memory backend */
#if defined(PH7_ENABLE_THREADS)
SyMutex *pMutex; /* Recursive mutex associated with VM. */
#endif
SyMutex *pMutex; /* Recursive mutex associated with VM */
ph7 *pEngine; /* Interpreter that own this VM */
SySet aInstrSet; /* Instructions debugging container */
SySet aByteCode; /* Default bytecode container */
@@ -1885,10 +1881,8 @@ PH7_PRIVATE void *SyMemBackendPoolAlloc(SyMemBackend *pBackend, sxu32 nBytes);
PH7_PRIVATE sxi32 SyMemBackendFree(SyMemBackend *pBackend, void *pChunk);
PH7_PRIVATE void *SyMemBackendRealloc(SyMemBackend *pBackend, void *pOld, sxu32 nBytes);
PH7_PRIVATE void *SyMemBackendAlloc(SyMemBackend *pBackend, sxu32 nBytes);
#if defined(PH7_ENABLE_THREADS)
PH7_PRIVATE sxi32 SyMemBackendMakeThreadSafe(SyMemBackend *pBackend, const SyMutexMethods *pMethods);
PH7_PRIVATE sxi32 SyMemBackendDisbaleMutexing(SyMemBackend *pBackend);
#endif
PH7_PRIVATE sxu32 SyMemcpy(const void *pSrc, void *pDest, sxu32 nLen);
PH7_PRIVATE sxi32 SyMemcmp(const void *pB1, const void *pB2, sxu32 nSize);
PH7_PRIVATE void SyZero(void *pSrc, sxu32 nSize);
@@ -1902,9 +1896,7 @@ PH7_PRIVATE sxu32 SyStrlen(const char *zSrc);
PH7_PRIVATE sxu32 Systrcpy(char *zDest, sxu32 nDestLen, const char *zSrc, sxu32 nLen);
PH7_PRIVATE char *SyStrtok(char *str, const char *sep);
PH7_PRIVATE sxi32 SyAsciiToHex(sxi32 c);
#if defined(PH7_ENABLE_THREADS)
PH7_PRIVATE const SyMutexMethods *SyMutexExportMethods(void);
PH7_PRIVATE sxi32 SyMemBackendMakeThreadSafe(SyMemBackend *pBackend, const SyMutexMethods *pMethods);
PH7_PRIVATE sxi32 SyMemBackendDisbaleMutexing(SyMemBackend *pBackend);
#endif
#endif /* __PH7INT_H__ */
#endif /* __PH7INT_H__ */