mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-10-04 09:08:30 +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
|
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
|
NETDB_OBJS = h_errno.o gethostbyaddr.o gethostbyname.o
|
||||||
|
|
||||||
|
@@ -43,3 +43,13 @@ void __init_mutex()
|
|||||||
sceKernelCreateLwMutex(&__fdman_mutex, "fdman mutex", 0, 0, 0);
|
sceKernelCreateLwMutex(&__fdman_mutex, "fdman mutex", 0, 0, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#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));
|
extern int sce_newlib_nocreate_thread_in_start __attribute__((weak));
|
||||||
|
|
||||||
int __psp_free_heap(void);
|
int __psp_free_heap(void);
|
||||||
|
void __deinit_mutex(void);
|
||||||
|
|
||||||
void _exit(int status)
|
void _exit(int status)
|
||||||
{
|
{
|
||||||
if (&sce_newlib_nocreate_thread_in_start != NULL) {
|
if (&sce_newlib_nocreate_thread_in_start != NULL) {
|
||||||
/* Free the heap created by _sbrk(). */
|
/* Free the heap created by _sbrk(). */
|
||||||
__psp_free_heap();
|
__psp_free_heap();
|
||||||
|
__deinit_mutex();
|
||||||
|
|
||||||
sceKernelSelfStopUnloadModule(1, 0, NULL);
|
sceKernelSelfStopUnloadModule(1, 0, NULL);
|
||||||
} else {
|
} else {
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
/* Free the heap created by _sbrk(). */
|
/* Free the heap created by _sbrk(). */
|
||||||
__psp_free_heap();
|
__psp_free_heap();
|
||||||
|
__deinit_mutex();
|
||||||
}
|
}
|
||||||
|
|
||||||
sceKernelExitThread(status);
|
sceKernelExitThread(status);
|
||||||
|
Reference in New Issue
Block a user