mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-10-03 16:51:27 +00:00
Deinit mutexs
This commit is contained in:
@@ -32,7 +32,7 @@ GLUE_OBJS = __fill_stat.o __psp_heap_blockid.o __psp_free_heap.o _fork.o _wait.o
|
||||
|
||||
INIT_OBJS = __libcglue_init.o
|
||||
|
||||
MUTEXMAN_OBJS = __malloc_mutex.o __sbrk_mutex.o __fdman_mutex.o __init_mutex.o
|
||||
MUTEXMAN_OBJS = __malloc_mutex.o __sbrk_mutex.o __fdman_mutex.o __init_mutex.o __deinit_mutex.o
|
||||
|
||||
NETDB_OBJS = h_errno.o gethostbyaddr.o gethostbyname.o
|
||||
|
||||
|
@@ -42,4 +42,14 @@ void __init_mutex()
|
||||
sceKernelCreateLwMutex(&__sbrk_mutex, "sbrk mutex", 0, 0, 0);
|
||||
sceKernelCreateLwMutex(&__fdman_mutex, "fdman mutex", 0, 0, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef F___deinit_mutex
|
||||
/* Create mutex used for making thread safe mallock and get fd */
|
||||
void __deinit_mutex()
|
||||
{
|
||||
sceKernelDeleteLwMutex(&__malloc_mutex);
|
||||
sceKernelDeleteLwMutex(&__sbrk_mutex);
|
||||
sceKernelDeleteLwMutex(&__fdman_mutex);
|
||||
}
|
||||
#endif
|
@@ -18,18 +18,21 @@
|
||||
extern int sce_newlib_nocreate_thread_in_start __attribute__((weak));
|
||||
|
||||
int __psp_free_heap(void);
|
||||
void __deinit_mutex(void);
|
||||
|
||||
void _exit(int status)
|
||||
{
|
||||
if (&sce_newlib_nocreate_thread_in_start != NULL) {
|
||||
/* Free the heap created by _sbrk(). */
|
||||
__psp_free_heap();
|
||||
__deinit_mutex();
|
||||
|
||||
sceKernelSelfStopUnloadModule(1, 0, NULL);
|
||||
} else {
|
||||
if (status == 0) {
|
||||
/* Free the heap created by _sbrk(). */
|
||||
__psp_free_heap();
|
||||
__deinit_mutex();
|
||||
}
|
||||
|
||||
sceKernelExitThread(status);
|
||||
|
Reference in New Issue
Block a user