diff --git a/demos/Win32-MinGW/Makefile b/demos/Win32-MinGW/Makefile index 9ee9dfb77..8d4edec7e 100644 --- a/demos/Win32-MinGW/Makefile +++ b/demos/Win32-MinGW/Makefile @@ -58,9 +58,10 @@ UADEFS = # List C source files here SRC = chcore.c demo.c \ ../../test/test.c ../../ports/win32/simcom.c \ - ../../src/chinit.c ../../src/chlists.c ../../src/chdelta.c ../../src/chschd.c \ - ../../src/chthreads.c ../../src/chsem.c ../../src/chevents.c ../../src/chmsg.c \ - ../../src/chsleep.c ../../src/chqueues.c ../../src/chserial.c + ../../src/chinit.c ../../src/chdebug.c ../../src/chlists.c ../../src/chdelta.c \ + ../../src/chschd.c ../../src/chthreads.c ../../src/chsem.c ../../src/chmtx.c \ + ../../src/chevents.c ../../src/chmsg.c ../../src/chsleep.c ../../src/chqueues.c \ + ../../src/chserial.c \ # List ASM source files here ASRC = chcore2.s diff --git a/demos/Win32-MinGW/demo.c b/demos/Win32-MinGW/demo.c index 7f8bd6903..acf17e7fd 100644 --- a/demos/Win32-MinGW/demo.c +++ b/demos/Win32-MinGW/demo.c @@ -159,7 +159,7 @@ static t_msg ShellThread(void *arg) { FullDuplexDriver *sd = (FullDuplexDriver *)arg; char *lp, line[64]; Thread *tp; - WorkingArea(tarea, 1024); + WorkingArea(tarea, 2048); chIQReset(&sd->sd_iqueue); chOQReset(&sd->sd_oqueue); @@ -221,7 +221,7 @@ static t_msg ShellThread(void *arg) { return 0; } -static WorkingArea(s1area, 2048); +static WorkingArea(s1area, 4096); static Thread *s1; EventListener s1tel; @@ -244,7 +244,7 @@ static void COM1Handler(t_eventid id) { chIQReset(&COM1.sd_iqueue); } -static WorkingArea(s2area, 2048); +static WorkingArea(s2area, 4096); static Thread *s2; EventListener s2tel; diff --git a/src/chmtx.c b/src/chmtx.c index d4da170e1..af2ac0262 100644 --- a/src/chmtx.c +++ b/src/chmtx.c @@ -212,23 +212,6 @@ void chMtxUnlockAll(void) { chSysLock(); - chMtxUnlockAllS(); - chSchRescheduleS(); - - chSysUnlock(); -} - -/** - * Unlocks all the mutexes owned by the invoking thread, this is MUCH MORE - * efficient than releasing the mutexes one by one and not just because the - * call overhead, this function does not have any overhead related to the - * priority inheritance mechanism. - * @note This function must be called within a \p chSysLock() / \p chSysUnlock() - * block. - * @note This function does not reschedule internally. - */ -void chMtxUnlockAllS(void) { - if (currp->p_mtxlist != NULL) { do { Mutex *mp = currp->p_mtxlist; @@ -238,7 +221,10 @@ void chMtxUnlockAllS(void) { chSchReadyI(fifo_remove(&mp->m_queue), RDY_OK); } while (currp->p_mtxlist != NULL); currp->p_prio = currp->p_realprio; + chSchRescheduleS(); } + + chSysUnlock(); } #endif /* CH_USE_MUTEXES */ diff --git a/src/include/mutexes.h b/src/include/mutexes.h index e2881423d..9e9422bd5 100644 --- a/src/include/mutexes.h +++ b/src/include/mutexes.h @@ -49,7 +49,6 @@ extern "C" { void chMtxUnlock(void); void chMtxUnlockS(void); void chMtxUnlockAll(void); - void chMtxUnlockAllS(void); #ifdef __cplusplus } #endif diff --git a/test/test.c b/test/test.c index 1687a36c7..30aa43a2d 100644 --- a/test/test.c +++ b/test/test.c @@ -23,7 +23,7 @@ void ChkIntSources(void); #endif -#if defined(WIN32) && defined(_DEBUG) +#if defined(WIN32) static WorkingArea(wsT1, 512); static WorkingArea(wsT2, 512); static WorkingArea(wsT3, 512); @@ -82,8 +82,11 @@ __attribute__((noinline)) void CPU(t_time ms) { t_time time = chSysGetTime() + ms; - while (chSysGetTime() != time) - ; + while (chSysGetTime() != time) { +#if defined(WIN32) + ChkIntSources(); +#endif + } } __attribute__((noinline)) @@ -518,6 +521,9 @@ void bench5(void) { i |= chIQGet(&iq) << 8; i |= chIQGet(&iq); i++; +#if defined(WIN32) + ChkIntSources(); +#endif } print("Queues throughput = "); printn(i * 4);