Differences From Artifact [f216b06c37]:
- File src/socket.m — part of check-in [68214158ee] at 2020-12-21 00:36:46 on branch trunk — Add destructors for global mutexes (user: js, size: 20947) [annotate] [blame] [check-ins using]
To Artifact [d886e134b6]:
- File
src/socket.m
— part of check-in
[9cedc18bb3]
at
2020-12-21 21:29:51
on branch trunk
— Don't send messages in destructors
In our tests, we call objc_exit() using atexit(), so the runtime is
already gone by the time any destructors get called. (user: js, size: 21005) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
52 53 54 55 56 57 58 59 60 61 62 63 64 65 | #ifdef OF_NINTENDO_3DS # include <3ds/types.h> # include <3ds/services/soc.h> #endif #if defined(OF_HAVE_THREADS) && (!defined(OF_AMIGAOS) || defined(OF_MORPHOS)) static OFMutex *mutex; #endif #if !defined(OF_AMIGAOS) || defined(OF_MORPHOS) || !defined(OF_HAVE_THREADS) static bool initSuccessful = false; #endif #ifdef OF_AMIGAOS # if defined(OF_HAVE_THREADS) && !defined(OF_MORPHOS) | > > > > > > | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | #ifdef OF_NINTENDO_3DS # include <3ds/types.h> # include <3ds/services/soc.h> #endif #if defined(OF_HAVE_THREADS) && (!defined(OF_AMIGAOS) || defined(OF_MORPHOS)) static OFMutex *mutex; static void releaseMutex(void) { [mutex release]; } #endif #if !defined(OF_AMIGAOS) || defined(OF_MORPHOS) || !defined(OF_HAVE_THREADS) static bool initSuccessful = false; #endif #ifdef OF_AMIGAOS # if defined(OF_HAVE_THREADS) && !defined(OF_MORPHOS) |
︙ | ︙ | |||
121 122 123 124 125 126 127 128 129 130 131 132 133 134 | return; atexit((void (*)(void))socExit); # endif # if defined(OF_HAVE_THREADS) && (!defined(OF_AMIGAOS) || defined(OF_MORPHOS)) mutex = [[OFMutex alloc] init]; # ifdef OF_WII if (of_spinlock_new(&spinlock) != 0) return; # endif # endif | > | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | return; atexit((void (*)(void))socExit); # endif # if defined(OF_HAVE_THREADS) && (!defined(OF_AMIGAOS) || defined(OF_MORPHOS)) mutex = [[OFMutex alloc] init]; atexit(releaseMutex); # ifdef OF_WII if (of_spinlock_new(&spinlock) != 0) return; # endif # endif |
︙ | ︙ | |||
142 143 144 145 146 147 148 | if (ISocket != NULL) DropInterface((struct Interface *)ISocket); # endif if (SocketBase != NULL) CloseLibrary(SocketBase); # endif | < < | 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | if (ISocket != NULL) DropInterface((struct Interface *)ISocket); # endif if (SocketBase != NULL) CloseLibrary(SocketBase); # endif } #endif bool of_socket_init(void) { #if !defined(OF_AMIGAOS) || defined(OF_MORPHOS) || !defined(OF_HAVE_THREADS) |
︙ | ︙ |