Browse Source

Added type gThread to replace V2.x gfxThreadHandle

inmarket 1 year ago
parent
commit
330f891081

+ 1 - 0
changelog.txt

@@ -18,6 +18,7 @@ CHANGE:		Added types gI8, gU8 .. gI32, gU32 to replace V2.x int8_t etc
18 18
 CHANGE:		Added type gBool           to replace V2.x bool_t,        and values gTrue/gFalse to replace TRUE/FALSE
19 19
 CHANGE:		Added type gDelay          to replace V2.x delaytime_t    and values gDelayNone/gDelayForever to replace TIME_IMMEDIATE/TIME_INFINITE
20 20
 CHANGE:		Added type gTicks          to replace V2.x systemticks_t
21
+CHANGE:		Added type gThread         to replace V2.x gfxThreadHandle
21 22
 CHANGE:		Added type gThreadreturn   to replace V2.x threadreturn_t
22 23
 CHANGE:		Added type gThreadpriority to replace V2.x threadpriority_t and values gThreadpriorityLow/Normal/High to replace LOW_/NORMAL_/HIGH_PRIORITY
23 24
 CHANGE:		Added type gPoint          to replace V2.x point and point_t

+ 1 - 1
demos/3rdparty/notepad-2/notepadApp.c

@@ -464,7 +464,7 @@ static DECLARE_THREAD_FUNCTION(notepadThread, param) {
464 464
 void nSetColorScheme(NColorScheme sch)  {  nCurColorScheme = sch; }
465 465
 NColorScheme nGetColorScheme(void)      { return nCurColorScheme; }
466 466
 
467
-gfxThreadHandle nLaunchNotepadApp(void) {
467
+gThread nLaunchNotepadApp(void) {
468 468
 
469 469
   return gfxThreadCreate(waNotepadThread,
470 470
 						   sizeof(waNotepadThread),

+ 1 - 1
demos/3rdparty/notepad-2/notepadApp.h

@@ -45,6 +45,6 @@ void nSetColorScheme(NColorScheme sch);
45 45
 NColorScheme nGetColorScheme(void);
46 46
 
47 47
 
48
-gfxThreadHandle nLaunchNotepadApp(void);
48
+gThread nLaunchNotepadApp(void);
49 49
 
50 50
 #endif /* NOTEPADAPP_H_ */

+ 1 - 1
demos/3rdparty/notepad-2/notepadCore.c

@@ -48,7 +48,7 @@ static DECLARE_THREAD_STACK(waDrawThread, NCORE_THD_STACK_SIZE);
48 48
 static uint8_t 					nPenWidth = 1;
49 49
 static uint8_t 					nMode = NCORE_MODE_DRAW;
50 50
 
51
-static gfxThreadHandle			nThd;
51
+static gThread			nThd;
52 52
 
53 53
 static GHandle					ncoreDrawingArea = NULL;
54 54
 static GHandle					nStatusConsole = NULL;

+ 1 - 1
demos/applications/combo/bounce.c

@@ -35,7 +35,7 @@
35 35
 
36 36
 static volatile gBool	run;
37 37
 static GHandle			gh;
38
-static gfxThreadHandle	thread;
38
+static gThread	thread;
39 39
 
40 40
 /**
41 41
  * NOTE:

+ 1 - 1
demos/applications/combo/mandelbrot.c

@@ -32,7 +32,7 @@
32 32
 
33 33
 static volatile gBool	run;
34 34
 static GHandle			gh;
35
-static gfxThreadHandle	thread;
35
+static gThread	thread;
36 36
 
37 37
 static void mandelbrot(float x1, float y1, float x2, float y2) {
38 38
 	unsigned int i,j, width, height;

+ 1 - 1
demos/modules/gos/threads_advanced/main.c

@@ -41,7 +41,7 @@
41 41
 #include "gfx.h"
42 42
 
43 43
 GTimer				gt;
44
-gfxThreadHandle		thd;
44
+gThread		thd;
45 45
 
46 46
 #if defined(WIN32)
47 47
 	#include <windows.h>

+ 1 - 1
drivers/multiple/X/gdisp_lld_X.c

@@ -302,7 +302,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) {
302 302
 	xPriv					*priv;
303 303
 
304 304
 	if (!initdone) {
305
-		gfxThreadHandle			hth;
305
+		gThread			hth;
306 306
 
307 307
 		initdone = gTrue;
308 308
 		#if GFX_USE_OS_LINUX || GFX_USE_OS_OSX

+ 1 - 1
drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c

@@ -165,7 +165,7 @@ typedef struct netPriv {
165 165
 	#endif
166 166
 } netPriv;
167 167
 
168
-static gfxThreadHandle	hThread;
168
+static gThread	hThread;
169 169
 
170 170
 #if GDISP_GFXNET_UNSAFE_SOCKETS
171 171
 	static gfxMutex	uGFXnetMutex;

+ 6 - 5
src/gos/gos.h

@@ -123,7 +123,7 @@
123 123
 	 * @brief	A thread handle
124 124
 	 * @note	Your operating system will have a proper definition for this.
125 125
 	 */
126
-	typedef void * gfxThreadHandle;
126
+	typedef void * gThread;
127 127
 
128 128
 	/*===========================================================================*/
129 129
 	/* Function declarations.                                                    */
@@ -420,7 +420,7 @@
420 420
 	 *
421 421
 	 * @api
422 422
 	 */
423
-	gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
423
+	gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
424 424
 
425 425
 	/**
426 426
 	 * @brief	Wait for a thread to finish.
@@ -432,7 +432,7 @@
432 432
 	 * 				once the thread has ended.
433 433
 	 * @api
434 434
 	 */
435
-	gThreadreturn gfxThreadWait(gfxThreadHandle thread);
435
+	gThreadreturn gfxThreadWait(gThread thread);
436 436
 
437 437
 	/**
438 438
 	 * @brief	Get the current thread handle.
@@ -440,7 +440,7 @@
440 440
 	 *
441 441
 	 * @api
442 442
 	 */
443
-	gfxThreadHandle gfxThreadMe(void);
443
+	gThread gfxThreadMe(void);
444 444
 
445 445
 	/**
446 446
 	 * @brief	Close the thread handle.
@@ -451,7 +451,7 @@
451 451
 	 *
452 452
 	 * @api
453 453
 	 */
454
-	void gfxThreadClose(gfxThreadHandle thread);
454
+	void gfxThreadClose(gThread thread);
455 455
 
456 456
 /**
457 457
  * All the above was just for the doxygen documentation. All the implementation of the above
@@ -501,6 +501,7 @@
501 501
 			#define TIME_INFINITE	gDelayForever
502 502
 		#endif
503 503
 	typedef gTicks			systemticks_t;
504
+	typedef gThread			gfxThreadHandle;
504 505
 	typedef gThreadreturn	threadreturn_t;
505 506
 	typedef gThreadpriority	threadpriority_t;
506 507
 		#define LOW_PRIORITY		gThreadpriorityLow

+ 1 - 1
src/gos/gos_chibios.c

@@ -175,7 +175,7 @@ void gfxSemSignalI(gfxSem *psem)
175 175
 	#endif
176 176
 }
177 177
 
178
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param)
178
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param)
179 179
 {
180 180
 	if (!stackarea) {
181 181
 		if (!stacksz) stacksz = 256;

+ 3 - 3
src/gos/gos_chibios.h

@@ -54,7 +54,7 @@ typedef tprio_t		gThreadpriority;
54 54
 	} gfxSem;
55 55
 
56 56
 	typedef Mutex		gfxMutex;
57
-	typedef Thread*		gfxThreadHandle;
57
+	typedef Thread*		gThread;
58 58
 #else
59 59
 	#undef DECLARE_THREAD_STACK
60 60
 	#define DECLARE_THREAD_STACK(a, b)  THD_WORKING_AREA(a, b)
@@ -65,7 +65,7 @@ typedef tprio_t		gThreadpriority;
65 65
 	} gfxSem;
66 66
 
67 67
 	typedef mutex_t		gfxMutex;
68
-	typedef thread_t*	gfxThreadHandle;
68
+	typedef thread_t*	gThread;
69 69
 #endif
70 70
 
71 71
 
@@ -110,7 +110,7 @@ gBool gfxSemWait(gfxSem *psem, gDelay ms);
110 110
 gBool gfxSemWaitI(gfxSem *psem);
111 111
 void gfxSemSignal(gfxSem *psem);
112 112
 void gfxSemSignalI(gfxSem *psem);
113
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
113
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
114 114
 #define gfxThreadWait(thread)		chThdWait(thread)
115 115
 #define gfxThreadMe()				chThdSelf()
116 116
 #define gfxThreadClose(thread)		(void)thread

+ 2 - 2
src/gos/gos_cmsis.c

@@ -88,7 +88,7 @@ void gfxSemSignalI(gfxSem* psem)
88 88
 	}
89 89
 }
90 90
 
91
-gfxThreadHandle gfxThreadCreate(void* stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param)
91
+gThread gfxThreadCreate(void* stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param)
92 92
 {	
93 93
 	osThreadDef_t def;
94 94
 
@@ -102,7 +102,7 @@ gfxThreadHandle gfxThreadCreate(void* stackarea, size_t stacksz, gThreadpriority
102 102
 	return osThreadCreate(&def, param);
103 103
 }
104 104
 
105
-gThreadreturn gfxThreadWait(gfxThreadHandle thread) {
105
+gThreadreturn gfxThreadWait(gThread thread) {
106 106
 	while(osThreadGetPriority(thread) == osPriorityError)
107 107
 		gfxYield();
108 108
 }

+ 2 - 2
src/gos/gos_cmsis.h

@@ -49,7 +49,7 @@ typedef struct gfxMutex {
49 49
 	osMutexId id;
50 50
 } gfxMutex;
51 51
 
52
-typedef osThreadId			gfxThreadHandle;
52
+typedef osThreadId			gThread;
53 53
 
54 54
 #define DECLARE_THREAD_STACK(name, sz)			uint8_t name[1];	// Some compilers don't allow zero sized arrays. Let's waste one byte
55 55
 #define DECLARE_THREAD_FUNCTION(fnName, param)	gThreadreturn fnName(void* param)
@@ -79,7 +79,7 @@ gBool gfxSemWaitI(gfxSem* psem);
79 79
 void gfxSemSignal(gfxSem* psem);
80 80
 void gfxSemSignalI(gfxSem* psem);
81 81
 
82
-gfxThreadHandle gfxThreadCreate(void* stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param);
82
+gThread gfxThreadCreate(void* stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param);
83 83
 #define gfxYield()					osThreadYield()
84 84
 #define gfxThreadMe()				osThreadGetId()
85 85
 #define gfxThreadClose(thread)		{}

+ 2 - 2
src/gos/gos_cmsis2.c

@@ -76,7 +76,7 @@ gBool gfxSemWait(gfxSem* psem, gDelay ms)
76 76
 	return gFalse;
77 77
 }
78 78
 
79
-gfxThreadHandle gfxThreadCreate(void* stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param)
79
+gThread gfxThreadCreate(void* stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param)
80 80
 {
81 81
 	osThreadAttr_t def;
82 82
 
@@ -93,7 +93,7 @@ gfxThreadHandle gfxThreadCreate(void* stackarea, size_t stacksz, gThreadpriority
93 93
 	return osThreadNew((osThreadFunc_t)fn, param, &def);
94 94
 }
95 95
 
96
-gThreadreturn gfxThreadWait(gfxThreadHandle thread) {
96
+gThreadreturn gfxThreadWait(gThread thread) {
97 97
 	while(1) {
98 98
 		switch(osThreadGetState(thread)) {
99 99
 		case osThreadReady:

+ 2 - 2
src/gos/gos_cmsis2.h

@@ -42,7 +42,7 @@ typedef osSemaphoreId_t		gfxSem;
42 42
 
43 43
 typedef osMutexId_t 		gfxMutex;
44 44
 
45
-typedef osThreadId_t		gfxThreadHandle;
45
+typedef osThreadId_t		gThread;
46 46
 
47 47
 #define DECLARE_THREAD_STACK(name, sz)			uint8_t name[1];	// Some compilers don't allow zero sized arrays. Let's waste one byte
48 48
 #define DECLARE_THREAD_FUNCTION(fnName, param)	gThreadreturn fnName(void* param)
@@ -72,7 +72,7 @@ gBool gfxSemWait(gfxSem* psem, gDelay ms);
72 72
 #define gfxSemSignal(psem)		osSemaphoreRelease(*(psem))
73 73
 #define gfxSemSignalI(psem)		osSemaphoreRelease(*(psem))
74 74
 
75
-gfxThreadHandle gfxThreadCreate(void* stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param);
75
+gThread gfxThreadCreate(void* stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void* param);
76 76
 #define gfxYield()					osThreadYield()
77 77
 #define gfxThreadMe()				osThreadGetId()
78 78
 #define gfxThreadClose(thread)		{}

+ 2 - 2
src/gos/gos_ecos.c

@@ -96,9 +96,9 @@ void gfxSemSignalI(gfxSem *psem)
96 96
 		cyg_semaphore_post(&psem->sem);
97 97
 }
98 98
 
99
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param)
99
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param)
100 100
 {
101
-	gfxThreadHandle		th;
101
+	gThread		th;
102 102
 
103 103
 	if (!stackarea) {
104 104
 		if (!stacksz) stacksz = CYGNUM_HAL_STACK_SIZE_TYPICAL;

+ 2 - 2
src/gos/gos_ecos.h

@@ -26,7 +26,7 @@ typedef cyg_tick_count_t	gTicks;
26 26
 typedef cyg_count32 		gSemcount;
27 27
 typedef void				gThreadreturn;
28 28
 typedef cyg_addrword_t		gThreadpriority;
29
-typedef cyg_handle_t		gfxThreadHandle;
29
+typedef cyg_handle_t		gThread;
30 30
 
31 31
 #define MAX_SEMAPHORE_COUNT			0x7FFFFFFF
32 32
 #define gThreadpriorityLow				(CYGNUM_KERNEL_SCHED_PRIORITIES-2)
@@ -77,7 +77,7 @@ gBool gfxSemWaitI(gfxSem *psem);
77 77
 void gfxSemSignal(gfxSem *psem);
78 78
 void gfxSemSignalI(gfxSem *psem);
79 79
 
80
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
80
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
81 81
 #define gfxThreadWait(thread)		NOTIMPLEMENTED_YET
82 82
 #define gfxThreadMe()				cyg_thread_self()
83 83
 #define gfxThreadClose(thread)		(void)thread

+ 3 - 3
src/gos/gos_freertos.c

@@ -146,9 +146,9 @@ void gfxSemSignalI(gfxSem* psem)
146 146
 	xSemaphoreGiveFromISR(*psem,&xHigherPriorityTaskWoken);
147 147
 }
148 148
 
149
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param)
149
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param)
150 150
 {
151
-	gfxThreadHandle task;
151
+	gThread task;
152 152
 	(void) stackarea;
153 153
 
154 154
 	// uGFX expresses stack size in bytes - FreeRTOS in "Stack Words"
@@ -165,7 +165,7 @@ gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority
165 165
 }
166 166
 
167 167
 #if INCLUDE_eTaskGetState == 1
168
-	gThreadreturn gfxThreadWait(gfxThreadHandle thread) {
168
+	gThreadreturn gfxThreadWait(gThread thread) {
169 169
 		while (eTaskGetState(thread) != eDeleted)
170 170
 			gfxYield();
171 171
 	}

+ 3 - 3
src/gos/gos_freertos.h

@@ -44,7 +44,7 @@ typedef portBASE_TYPE		gThreadpriority;
44 44
 
45 45
 typedef xSemaphoreHandle		gfxSem;
46 46
 typedef xSemaphoreHandle		gfxMutex;
47
-typedef xTaskHandle				gfxThreadHandle;
47
+typedef xTaskHandle				gThread;
48 48
 
49 49
 /*===========================================================================*/
50 50
 /* Function declarations.                                                    */
@@ -75,11 +75,11 @@ gBool gfxSemWait(gfxSem* psem, gDelay ms);
75 75
 gBool gfxSemWaitI(gfxSem* psem);
76 76
 void gfxSemSignal(gfxSem* psem);
77 77
 void gfxSemSignalI(gfxSem* psem);
78
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
78
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
79 79
 
80 80
 #define gfxThreadMe()				xTaskGetCurrentTaskHandle()
81 81
 #if INCLUDE_eTaskGetState == 1
82
-	gThreadreturn gfxThreadWait(gfxThreadHandle thread);
82
+	gThreadreturn gfxThreadWait(gThread thread);
83 83
 #endif
84 84
 #define gfxThreadClose(thread)
85 85
 

+ 3 - 3
src/gos/gos_linux.c

@@ -109,8 +109,8 @@ gTicks gfxSystemTicks(void) {
109 109
 	return ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
110 110
 }
111 111
 
112
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) {
113
-	gfxThreadHandle		th;
112
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) {
113
+	gThread		th;
114 114
 	(void)				stackarea;
115 115
 	(void)				stacksz;
116 116
 	(void)				prio;
@@ -128,7 +128,7 @@ gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority
128 128
 	return th;
129 129
 }
130 130
 
131
-gThreadreturn gfxThreadWait(gfxThreadHandle thread) {
131
+gThreadreturn gfxThreadWait(gThread thread) {
132 132
 	gThreadreturn	retval;
133 133
 
134 134
 	if (pthread_join(thread, &retval))

+ 3 - 3
src/gos/gos_linux.h

@@ -26,7 +26,7 @@
26 26
 typedef unsigned long		gTicks;
27 27
 typedef void *				gThreadreturn;
28 28
 typedef unsigned long		gDelay;
29
-typedef pthread_t 			gfxThreadHandle;
29
+typedef pthread_t 			gThread;
30 30
 typedef int					gThreadpriority;
31 31
 typedef uint32_t			gSemcount;
32 32
 typedef pthread_mutex_t		gfxMutex;
@@ -85,8 +85,8 @@ void gfxSemInit(gfxSem *psem, gSemcount val, gSemcount limit);
85 85
 void gfxSemDestroy(gfxSem *psem);
86 86
 gBool gfxSemWait(gfxSem *psem, gDelay ms);
87 87
 void gfxSemSignal(gfxSem *psem);
88
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
89
-gThreadreturn gfxThreadWait(gfxThreadHandle thread);
88
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
89
+gThreadreturn gfxThreadWait(gThread thread);
90 90
 
91 91
 #endif /* GFX_USE_OS_LINUX */
92 92
 

+ 3 - 3
src/gos/gos_osx.c

@@ -92,8 +92,8 @@ gTicks gfxSystemTicks(void) {
92 92
 	return ts.tv_sec * 1000UL + ts.tv_nsec / 1000000;
93 93
 }
94 94
 
95
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) {
96
-	gfxThreadHandle		th;
95
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) {
96
+	gThread		th;
97 97
 	(void)				stackarea;
98 98
 	(void)				stacksz;
99 99
 	(void)				prio;
@@ -110,7 +110,7 @@ gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority
110 110
 	return th;
111 111
 }
112 112
 
113
-gThreadreturn gfxThreadWait(gfxThreadHandle thread) {
113
+gThreadreturn gfxThreadWait(gThread thread) {
114 114
 	gThreadreturn	retval;
115 115
 
116 116
 	if (pthread_join(thread, &retval))

+ 3 - 3
src/gos/gos_osx.h

@@ -17,7 +17,7 @@
17 17
 typedef unsigned long		gTicks;
18 18
 typedef void *				gThreadreturn;
19 19
 typedef unsigned long		gDelay;
20
-typedef pthread_t 			gfxThreadHandle;
20
+typedef pthread_t 			gThread;
21 21
 typedef int					gThreadpriority;
22 22
 typedef uint32_t			gSemcount;
23 23
 typedef pthread_mutex_t		gfxMutex;
@@ -69,8 +69,8 @@ void gfxSemInit(gfxSem *psem, gSemcount val, gSemcount limit);
69 69
 void gfxSemDestroy(gfxSem *psem);
70 70
 gBool gfxSemWait(gfxSem *psem, gDelay ms);
71 71
 void gfxSemSignal(gfxSem *psem);
72
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
73
-gThreadreturn gfxThreadWait(gfxThreadHandle thread);
72
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
73
+gThreadreturn gfxThreadWait(gThread thread);
74 74
 
75 75
 #endif /* GFX_USE_OS_OSX */
76 76
 #endif /* _GOS_OSX_H */

+ 5 - 5
src/gos/gos_qt.cpp

@@ -185,7 +185,7 @@ void gfxSemSignalI(gfxSem *psem)
185 185
     static_cast<QSemaphore*>(*psem)->release(1);
186 186
 }
187 187
 
188
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param)
188
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param)
189 189
 {
190 190
     Q_UNUSED(stackarea)
191 191
 
@@ -196,10 +196,10 @@ gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority
196 196
     }
197 197
     thread->start(static_cast<QThread::Priority>(prio));
198 198
 
199
-    return static_cast<gfxThreadHandle>(thread);
199
+    return static_cast<gThread>(thread);
200 200
 }
201 201
 
202
-gThreadreturn gfxThreadWait(gfxThreadHandle thread)
202
+gThreadreturn gfxThreadWait(gThread thread)
203 203
 {
204 204
     Thread* t = static_cast<Thread*>(thread);
205 205
 
@@ -210,12 +210,12 @@ gThreadreturn gfxThreadWait(gfxThreadHandle thread)
210 210
     return returnValue;
211 211
 }
212 212
 
213
-gfxThreadHandle gfxThreadMe(void)
213
+gThread gfxThreadMe(void)
214 214
 {
215 215
     return static_cast<Thread*>(QThread::currentThread());
216 216
 }
217 217
 
218
-void gfxThreadClose(gfxThreadHandle thread)
218
+void gfxThreadClose(gThread thread)
219 219
 {
220 220
     static_cast<Thread*>(thread)->exit();
221 221
 }

+ 5 - 5
src/gos/gos_qt.h

@@ -28,7 +28,7 @@ typedef void* gfxSem;
28 28
 typedef int gSemcount;
29 29
 typedef int gThreadreturn;
30 30
 typedef int gThreadpriority;
31
-typedef void* gfxThreadHandle;
31
+typedef void* gThread;
32 32
 
33 33
 void _gosInit();
34 34
 void _gosDeinit();
@@ -55,10 +55,10 @@ gBool gfxSemWait(gfxSem *psem, gDelay ms);
55 55
 gBool gfxSemWaitI(gfxSem *psem);
56 56
 void gfxSemSignal(gfxSem *psem);
57 57
 void gfxSemSignalI(gfxSem *psem);
58
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
59
-gThreadreturn gfxThreadWait(gfxThreadHandle thread);
60
-gfxThreadHandle gfxThreadMe(void);
61
-void gfxThreadClose(gfxThreadHandle thread);
58
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
59
+gThreadreturn gfxThreadWait(gThread thread);
60
+gThread gfxThreadMe(void);
61
+void gfxThreadClose(gThread thread);
62 62
 
63 63
 #endif /* GFX_USE_OS_QT */
64 64
 #endif /* _GOS_QT_H */

+ 2 - 2
src/gos/gos_rawrtos.c

@@ -75,10 +75,10 @@ gBool gfxSemWaitI(gfxSem* psem)
75 75
 	return gFalse;
76 76
 }
77 77
 
78
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param)
78
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param)
79 79
 {
80 80
 	RAW_U16 ret;
81
-	gfxThreadHandle taskobj;
81
+	gThread taskobj;
82 82
 
83 83
 	taskobj = gfxAlloc(sizeof(RAW_TASK_OBJ));
84 84
 	ret = raw_task_create(taskobj, (RAW_U8  *)"uGFX_TASK", param,

+ 2 - 2
src/gos/gos_rawrtos.h

@@ -20,7 +20,7 @@ typedef RAW_U8				gThreadpriority;
20 20
 
21 21
 typedef RAW_SEMAPHORE		gfxSem;
22 22
 typedef RAW_MUTEX			gfxMutex;
23
-typedef RAW_TASK_OBJ*		gfxThreadHandle;
23
+typedef RAW_TASK_OBJ*		gThread;
24 24
 
25 25
 #define DECLARE_THREAD_FUNCTION(fnName, param)	gThreadreturn fnName(void *param)
26 26
 #define DECLARE_THREAD_STACK(name, sz)			PORT_STACK name[(sz) & ~3];
@@ -67,7 +67,7 @@ void gfxSleepMilliseconds(gDelay ms);
67 67
 void gfxSleepMicroseconds(gDelay us);
68 68
 gBool gfxSemWait(gfxSem* psem, gDelay ms);
69 69
 gBool gfxSemWaitI(gfxSem* psem);
70
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
70
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
71 71
 
72 72
 #endif
73 73
 

+ 2 - 2
src/gos/gos_win32.c

@@ -103,7 +103,7 @@ gSemcount gfxSemCounter(gfxSem *pSem) {
103 103
 }
104 104
 */
105 105
 
106
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION(*fn,p), void *param) {
106
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION(*fn,p), void *param) {
107 107
 	(void)	stackarea;
108 108
 	HANDLE	thd;
109 109
 
@@ -116,7 +116,7 @@ gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority
116 116
 	return thd;
117 117
 }
118 118
 
119
-gThreadreturn gfxThreadWait(gfxThreadHandle thread) {
119
+gThreadreturn gfxThreadWait(gThread thread) {
120 120
 	DWORD	ret;
121 121
 
122 122
 	WaitForSingleObject(thread, INFINITE);

+ 3 - 3
src/gos/gos_win32.h

@@ -44,7 +44,7 @@ typedef int					gThreadpriority;
44 44
 
45 45
 typedef HANDLE gfxSem;
46 46
 typedef HANDLE gfxMutex;
47
-typedef HANDLE gfxThreadHandle;
47
+typedef HANDLE gThread;
48 48
 
49 49
 #define gfxExit()						ExitProcess(0)
50 50
 #define gfxAlloc(sz)					malloc(sz)
@@ -75,8 +75,8 @@ void gfxSleepMicroseconds(gDelay ms);
75 75
 gBool gfxSemWait(gfxSem *psem, gDelay ms);
76 76
 void gfxSystemLock(void);
77 77
 void gfxSystemUnlock(void);
78
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION(*fn,p), void *param);
79
-gThreadreturn gfxThreadWait(gfxThreadHandle thread);
78
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION(*fn,p), void *param);
79
+gThreadreturn gfxThreadWait(gThread thread);
80 80
 
81 81
 #endif /* GFX_USE_OS_WIN32 */
82 82
 #endif /* _GOS_WIN32_H */

+ 4 - 4
src/gos/gos_x_threads.c

@@ -457,8 +457,8 @@ void _gosThreadsInit(void) {
457 457
 	_gfxCurrentThread = &mainthread;
458 458
 }
459 459
 
460
-gfxThreadHandle gfxThreadMe(void) {
461
-	return (gfxThreadHandle)_gfxCurrentThread;
460
+gThread gfxThreadMe(void) {
461
+	return (gThread)_gfxCurrentThread;
462 462
 }
463 463
 
464 464
 // Check if there are dead processes to deallocate
@@ -508,7 +508,7 @@ void gfxThreadExit(gThreadreturn ret) {
508 508
 	// We never get back here as we didn't re-queue ourselves
509 509
 }
510 510
 
511
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) {
511
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) {
512 512
 	thread *	t;
513 513
 	thread *	me;
514 514
 	(void)		prio;
@@ -543,7 +543,7 @@ gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority
543 543
 	return t;
544 544
 }
545 545
 
546
-gThreadreturn gfxThreadWait(gfxThreadHandle th) {
546
+gThreadreturn gfxThreadWait(gThread th) {
547 547
 	thread *		t;
548 548
 
549 549
 	t = th;

+ 4 - 4
src/gos/gos_x_threads.h

@@ -47,7 +47,7 @@ typedef struct {
47 47
 } gfxSem;
48 48
 
49 49
 typedef uint32_t		gfxMutex;
50
-typedef void *			gfxThreadHandle;
50
+typedef void *			gThread;
51 51
 
52 52
 // Required timing functions - supplied by the user or the operating system
53 53
 gTicks gfxSystemTicks(void);
@@ -77,10 +77,10 @@ void gfxSemSignal(gfxSem *psem);
77 77
 void gfxSemSignalI(gfxSem *psem);
78 78
 
79 79
 // Threads
80
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
80
+gThread gfxThreadCreate(void *stackarea, size_t stacksz, gThreadpriority prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
81 81
 #define gfxThreadClose(thread)
82
-gThreadreturn gfxThreadWait(gfxThreadHandle thread);
83
-gfxThreadHandle gfxThreadMe(void);
82
+gThreadreturn gfxThreadWait(gThread thread);
83
+gThread gfxThreadMe(void);
84 84
 
85 85
 /** The following is not part of the public ugfx API as some operating systems
86 86
  * 	simply do not provide this capability.

+ 1 - 1
src/gos/gos_zephyr.h

@@ -41,7 +41,7 @@ typedef struct k_sem gfxSem;
41 41
 
42 42
 typedef struct k_mutex gfxMutex;
43 43
 
44
-typedef k_tid_t gfxThreadHandle;
44
+typedef k_tid_t gThread;
45 45
 
46 46
 /*===========================================================================*/
47 47
 /* Function declarations.                                                    */

+ 1 - 1
src/gtimer/gtimer.c

@@ -19,7 +19,7 @@
19 19
 
20 20
 /* This mutex protects access to our tables */
21 21
 static gfxMutex			mutex;
22
-static gfxThreadHandle	hThread = 0;
22
+static gThread	hThread = 0;
23 23
 static GTimer			*pTimerHead = 0;
24 24
 static gfxSem			waitsem;
25 25
 static gTicks	ticks2ms;