Re: [AD] WIP 4.1.15 and CVS freeze |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Sun, 2004-07-25 at 22:19 +0200, Elias Pschernig wrote:
> Once it is applied, system_driver->yield_timeslice on BeOS/QNX/MacOSX
> should be adjusted to behave like on other systems (no waiting).
>
Well, the attached patch tries to do that. I think it can be applied for
4.1.15. All it does it passing 0 to the various sleep functions. In the
worst case, it will make rest(0) do nothing at all for those 3
platforms. And I'm not sure if e.g. sched_yield is available for OSX.
--
Elias Pschernig
Index: src/beos/bsysapi.cpp
===================================================================
RCS file: /cvsroot/alleg/allegro/src/beos/bsysapi.cpp,v
retrieving revision 1.25
diff -u -p -r1.25 bsysapi.cpp
--- src/beos/bsysapi.cpp 2 Jul 2004 16:25:41 -0000 1.25
+++ src/beos/bsysapi.cpp 27 Jul 2004 15:57:33 -0000
@@ -36,8 +36,6 @@
#define EXE_NAME_UNKNOWN "./UNKNOWN"
-#define YIELD_TIME 30000
-
status_t ignore_result = 0;
@@ -428,7 +426,7 @@ extern "C" void be_sys_get_gfx_safe_mode
extern "C" void be_sys_yield_timeslice(void)
{
- snooze(YIELD_TIME);
+ snooze(0);
}
Index: src/qnx/qsystem.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/qnx/qsystem.c,v
retrieving revision 1.30
diff -u -p -r1.30 qsystem.c
--- src/qnx/qsystem.c 22 Dec 2002 10:11:01 -0000 1.30
+++ src/qnx/qsystem.c 27 Jul 2004 15:57:34 -0000
@@ -563,7 +563,7 @@ static void qnx_sys_get_gfx_safe_mode(in
*/
static void qnx_sys_yield_timeslice(void)
{
- usleep(10000);
+ usleep(0);
}
Index: src/macosx/system.m
===================================================================
RCS file: /cvsroot/alleg/allegro/src/macosx/system.m,v
retrieving revision 1.24
diff -u -p -r1.24 system.m
--- src/macosx/system.m 11 Jul 2004 12:15:30 -0000 1.24
+++ src/macosx/system.m 27 Jul 2004 15:57:34 -0000
@@ -561,7 +561,7 @@ static void osx_sys_get_gfx_safe_mode(in
*/
static void osx_sys_yield_timeslice(void)
{
- usleep(30000);
+ usleep(0);
}