소스 검색

Added thread register/unregister.

woollybah 5 년 전
부모
커밋
1d73792755
2개의 변경된 파일13개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 0
      sdl.mod/SDL/src/thread/SDL_thread.c
  2. 6 1
      sdl.mod/sdl.bmx

+ 7 - 0
sdl.mod/SDL/src/thread/SDL_thread.c

@@ -29,6 +29,7 @@
 #include "SDL_hints.h"
 #include "../SDL_error_c.h"
 
+#include "brl.mod/blitz.mod/blitz.h"
 
 SDL_TLSID
 SDL_TLSCreate()
@@ -285,9 +286,15 @@ SDL_RunThread(void *data)
     /* Wake up the parent thread */
     SDL_SemPost(args->wait);
 
+	/* register with BlitzMax */
+	BBThread * bbThread = bbThreadRegister(SDL_ThreadID());
+
     /* Run the function */
     *statusloc = userfunc(userdata);
 
+	/* unregister with BlitzMax */
+	bbThreadUnregister(bbThread);
+
     /* Clean up thread-local storage */
     SDL_TLSCleanup();
 

+ 6 - 1
sdl.mod/sdl.bmx

@@ -92,7 +92,12 @@ ModuleInfo "LD_OPTS: -L%nx.devkitpro%/portlibs/switch/lib"
 '        Some versions of MinGW have it, some don't...
 '
 'ModuleInfo "CC_OPTS: -DHAVE_XINPUT_GAMEPAD_EX -DHAVE_XINPUT_STATE_EX"
-
+'
+' Source changes : 
+'       SDL/src/thread/SDL_thread.c
+'          Added thread register/unregister.
+'
+'
 Import "-limm32"
 Import "-lole32"
 Import "-loleaut32"